ふくしま

ソフトウェアエンジニア

Flavor で firebase の prod と dev を分ける時に気をつけたこと

概要

基本的には以下の記事をやるだけ。GIF がついていてとてもわかりやすい。

https://medium.com/@animeshjain/build-flavors-in-flutter-android-and-ios-with-different-firebase-projects-per-flavor-27c5c5dac10b

ただ一点だけ、iOS において prod で run したときに以下のエラーが出た。

    xcodebuild: error: Unable to find a destination matching the provided destination specifier:
                { id:xxxxxxxxxxxxxxx }

        Available destinations for the "prod" scheme:
                { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:xxxxxxxxxxxxxxx }

        Ineligible destinations for the "prod" scheme:
                { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }

これは、dev でやっとことを prod でもやることで通るようになるのだが、おそらく記事に書かれていない。

結論、Connect “dev” build configurations to “dev” scheme の GIFに書いてあることを prod のスキーマに対しても dev を prod に置き換えて行うと良い。