パパエンジニアのアウトプット帳

30歳に突入した1児のパパエンジニアのブログ

React Nativeでrun-iosした時にPrint: Entry, ":CFBundleIdentifier", Does Not Existになってしまう問題

react-native run-iosを実行した時に下記のようなメッセージが表示されてしまい、アプリが起動しなかった。

XCodeでRunするとちゃんとアプリが起動する)

The following commands produced analyzer issues:
    Analyze Modules/RCTRedBox.m
(1 command with analyzer issues)

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


ググると下記のQiitaページがヒットするが、ちょっと今回の事象とは違う。

(RCTSRWebSocketのエラーは出てない)

qiita.com


もう少し調べてみると、react-nativeのissueでそれらしきものを発見。 下記のコメントの対応で解決した。

github.com

build/Build/Productsにするだけでなく、"Relative to Workspace"を選択するのがポイントみたい。