yarn ios
を実行した時に以下のエラーが出たので解決方法を調べてまとめました。
エラー内容
$ yarn ios
yarn run v1.22.19
$ expo run:ios
› Skipping dev server
› Planning build
❌ error: Cycle in dependencies between targets 'EXScreenOrientation' and 'ExpoModulesCore'; building could produce unreliable results.
Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'bluebirdapp' from project 'bluebirdapp')
Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'bluebirdapp' from project 'bluebirdapp')
› 1 error(s), and 3 warning(s)
CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
原因、対策
色々調べると、キャッシュが悪さをしているみたいでした。
$ (cd ios && rm -rf Pods && pod install)
こちらのコマンドでiosディレクトリ内のPodsを一旦削除し、再インストールを実行。 無事yarn iosでビルドでき、エミュレータが起動しました。