【Flutter】 Error launching application on iPhone
エラー
Could not build the application for the simulator. Error launching application on iPhone 13.
最近よく出るので、解決した手順をまとめました。
環境
MacOS Monterey 12.1
Android studio Arctic Fox2020 3.1 patch4
やったこと
cd ios
pod install --repo-update
flutter clean
flutter pub get
flutter pub upgrade
以下削除
Podfile, Podfile.lock, Pods folder within ios folder of the project
Run flutter clean
Run flutter run
参考
Flutter Error running pod install After Upgrading Flutter version - Stack Overflow
PodfileとPodfile.lockとは?
CocoaPodsにおけるPodfileとPodfile.lockの意味をまず確認しましょう。
Podfileは「ライブラリのバージョン指定などをするファイル」です。
Podfile.lockは「ロック(固定)されたバージョンの情報が格納されているファイル」です。.lockファイルは、pod initやpod install時に自動生成されます。
参考サイト
エラー
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
flutter run --verboseで出てきた以下エラー対処メモ
caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Xcodeでrunしたら
以下症状。
ios - error: Build input file cannot be found: '/Users/GoogleService-Info.plist' (in target 'Runner' from project 'Runner') - Stack Overflow
Remove the GoogleService-Info.plist and then again add the file into the Runner directory using Xcode, then choose copy items if needed and add to target checkmark. I hope this will solve your problem.
GoogleService-Info.plistをXcode側で削除してRunnerフォルダに入れたら
解決した。
iosビルド周りはXcodeでもerror見た方がいいと思う。
providerをバージョンアップ後エラー
CocoaPods's specs repository is too out-of-date to satisfy dependencies
解決手順
sudo arch -x86_64 gem install ffi
cd ios && arch -x86_64 pod install && cd ../
podfile.lockを削除して、
pod install
podfileで
platform :ios, '9.0' のコメントアウトを外して
platform :ios, '10.0' へ変更
参考サイト
[error report] pod install /w m1 macbook · Issue #10518 · CocoaPods/CocoaPods
ios - CocoaPods could not find compatible versions for pod "Firebase/CoreOnly" - Stack Overflow