【Cordova】iOSの「The GOOGLE_APP_ID either in the plist file ‘GoogleService-Info.plist’ or the one set in the customized options is invalid.」エラーの対処法

  • 2018年5月21日
  • iOS

タイトルが長くてすみません。
今回は、Cordovaで開発中のアプリが、Simulator・実機問わず、急に実行時に落ちる様になってしまったので、その対処法についてです。

ちなみに、エラー全文はこちらです。

The GOOGLE_APP_ID either in the plist file ‘GoogleService-Info.plist’ or the one set in the customized options is invalid. If you are using the plist file, use the iOS version of bundle identifier to download the file, and do not manually edit the GOOGLE_APP_ID. You may change your app’s bundle identifier to ‘(null)’. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.

凄く長いので、読むのも一苦労ですが、Google翻訳にかけてみたところ、「‘GoogleService-Info.plist’またはカスタマイズされたオプションに設定されているGOOGLE_APP_IDは無効です。」とのこと。
エラー文の中にもある「GoogleService-Info.plist」が何らかの理由で壊れていることが原因らしいです。

なお、今回参考にした投稿はこちら。

iOS : invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options #308 − fechanique/cordova-plugin-fcm
https://github.com/fechanique/cordova-plugin-fcm/issues/308

今回のエラーと全く同じ質問でした。
どうやら「GoogleService-Info.plist」ファイルは壊れやすいようです。

 

対処法は至って簡単です。
私の環境では、platforms/ios/[プロジェクト名]/Resources/Resources にある GoogleService-Info.plist が壊れていたことが原因だったため、その一つ上のディレクトリの platforms/ios/[プロジェクト名]/Resources/ にある「GoogleService-Info.plist」をコピーするだけでした。
なお、すでにファイルが有る場合は上書きします。
あとは、通常通り実行すれば、問題なく起動・動作しました。
これで一件落着です。

 

以上、iOSの実機でアプリが実行できなかったときの対処法でした。
とりあえず、わからないエラーは丸々コピーして、Googleなどで検索しましょう。
大概の投稿者は、投稿記事にエラー文を載せているので、2〜3記事も見れば、解決策がヒットするはずです。

>株式会社シーポイントラボ

株式会社シーポイントラボ

TEL:053-543-9889
営業時間:9:00~18:00(月〜金)
住所:〒432-8003
   静岡県浜松市中央区和地山3-1-7
   浜松イノベーションキューブ 315
※ご来社の際はインターホンで「316」をお呼びください

CTR IMG