Flutterで初めてiOSビルドした時に躓いたところの備忘録
結構エラーメッセージが親切なのでそれ見ながらやっていけばある程度は進められる。
XCodeの設定関係で怒られる場合こんなのが出たりする:
code:.txt
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with your Apple ID
in Xcode and create an iOS Development Certificate as well as a Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS device
For more information, please visit:
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
Or run on an iOS simulator without code signing
とりあえず1-から読んで大人しく従っていくことで対応が完了するはず。
日本語解説は以下の記事が大変役に立ちました。圧倒的感謝
設定の最後に、アプリ転送先デバイスの設定を正しく行っておくこと。
画面上部のRunner > {デバイス名} のところをクリックして、自身の扱う端末を選べばOK。
たまにこれがよくわからないデバイスを指してたりする
最後に、ビルドはうまくいくものの実行しようとした時にエラーになるケースがある。
(デバッグビルド、開発者未登録のアカウントでのビルド時限定?詳細未調査)
IDEDebugSessionErrorDomain
ときたら、転送先端末の設定 -> 一般 -> デバイス管理と進んで今回ビルドに使用したアカウントを選ぶ。
信頼設定が表示されるので、Appを信頼するように設定を行えばOK。
筆者の場合はここまで行うことでXCodeからのビルドと実行に成功した。