LoginSignup
25
12

More than 3 years have passed since last update.

React Nativeでinit直後の`Print: Entry, ":CFBundleIdentifier", Does Not Exist`を直した

Last updated at Posted at 2017-03-04

*これ以外にも解決方法があるようなのでこれで解決しなかったら他のエントリも参照ください。

react-native run-iosを実行したとき、ログを見ると

Installing build/Build/Products/Debug-iphonesimulator/MyApp.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/MyApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

と出てたので、そのままの場所で

ls ios/build/Build/Products/Debug-iphonesimulator/

とすると何もない。
なので、ここに色々吐き出すようにxcodeで設定する。

Xcodeの設定変更

  1. xcodeでxcworkspaceを開く
  2. Menu > Xcode > Preference > Locations を開く
    スクリーンショット 2019-07-14 12.12.37.png

  3. Advanced...ボタン押す
    スクリーンショット 2019-07-14 21.03.27.png

  4. 以下のように設定。

スクリーンショット 2019-07-14 21.03.42.png

Doneを押してもう一度react-native run-iosで確認。

Watchmanのpermission errorが出た場合

以前はXcodeの修正をすればよかったのですが、最近改めて確認したら以下のようなwatchmanのエラーが出てしまった。

Loading dependency graph...2019-07-14T17:56:49,808: [241456576] opendir(/usr/local/var/run/watchman/gen-state): Permission denied

Watchman:  watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2019-07-14T17:56:49,808: [241456576] opendir(/usr/local/var/run/watchman/gen-state): Permission denied

まぁ、権限あたえるしかないようだったのでchownで権限を与えます。

sudo chown -R $USER:$GROUP /usr/local/var/run/watchman/

もう一度react-native run-iosで確認。

参考:環境

$ react-native -version
react-native-cli: 2.0.1
react-native: 0.60.3

$ xcodebuild -version
Xcode 10.2.1
Build version 10E1001

$ watchman --version
4.9.0

以上!

25
12
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
12