2017-09-17 74 views
0

我决定改变我的React Native项目的名称,方法是首先在主目录中更改它,通过删除其名称来命名它为“AppName”。改变项目名称后,react-native run-ios将无法工作

我还将ios中的所有文件夹名称更改为AppName,并删除了以前的名称。

即使在index.ios.js里面,我也摆脱了以前的名字。

但是,每当我跑react-native run-ios,我得到以下错误:

Installing build/Build/Products/Debug-iphonesimulator/AppName.app 
An error was encountered processing the command 
(domain=NSPOSIXErrorDomain, code=2): 
Failed to install the requested application 
An application bundle was not found at the provided path. 
Provide a valid path to the desired application bundle. 
Print: Entry, ":CFBundleIdentifier", Does Not Exist 

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier 
build/Build/Products/Debug-iphonesimulator/AppName.app/Info.plist 
Print: Entry, ":CFBundleIdentifier", Does Not Exist 

为什么会出现这个错误?我知道这与改变我的项目名称有关。

+0

编辑你的包标识符了。它必须与您的项目具有相同的名称:'com.myCompany.projectName'。 – Li357

回答

0

重命名react native项目,你应该使用react-native-rename 因为手动重命名会打破你的项目