Help us understand the problem. What is going on with this article?

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

以上!

gki
leomo
サイクリスト向けデバイス・サービスを開発・運営するスタートアップ
https://www.leomo.io/
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした