LoginSignup
2
2

More than 1 year has passed since last update.

React NativeのiOSビルドが突然できなくなった

Posted at

現象

ついこの間までビルドやシミュレータでのデバッグができていたのに、週明けたらできなくなってた

シミュレータは立ち上がるが、コンソールにはBUILD FAILEDが(控えめに)出て、シミュレータ上でアプリが更新されない

TestFlightに上げるための、XCode上でのビルドも失敗する

環境

  • MacBookAir 11.4
  • react-native v0.63.2

エラー内容

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening [プロジェクト名].xcworkspace. Run CLI with --verbose flag for more details.

...

/[プロジェクトパス]/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'react-native-date-picker' from project 'Pods')

** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/takayukiono/Library/Developer/Xcode/DerivedData/[プロジェクト名]-ccqjxurifndgxheowdqriugyxlmf/Build/Intermediates.noindex/[プロジェクト名].build/Debug-iphonesimulator/[プロジェクト名].build/Script-4DD7404CB94F2720CFD58C9B.sh (in target '[プロジェクト名]' from project '[プロジェクト名]')
(1 failure)

[プロジェクト名] など伏せ字はありますが、このようなエラーが出ました

--verboseをつけて react-native run-ios --verbose とやったら

fatal error: 'React/RCTBridgeDelegate.h' file not found

も出てきた

試したこと

1 キャッシュクリア
よくあるエラーを解決してくれるそう

でも、同じくエラー…

2 fatal error: 'React/RCTBridgeDelegate.h' file not found でググった

pod install もう一回やった

キャッシュクリアしてたから出たエラーかな?(--verboseつけて再実行したのがキャッシュクリア後だったので…)

結果、ビルド成功!

まとめ

watchman watch-del-all
lsof -n -P -i :8081 -t | xargs kill
rm -rf ios/build
rm -rf android/app/build
rm -rf node_modules && npm install
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios
pod deintegrate
pod setup
bundle exec pod install

自分はpod install失敗してたっぽいので、その後に

pod install
2
2
0

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
2
2