2017-09-17 25 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 因爲手動重命名會打破你的項目