13
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

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

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

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

以上!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
13
Help us understand the problem. What are the problem?