AppSeedのアプリ開発ブログ

アプリ開発会社AppSeed(アップシード)開発担当のブログです。iOS、Android、Unity、Cocos2d-xなどアプリ開発関連のTipsや備忘録、アプリ開発に役立つ情報を発信します。

【Unity】Firebaseで「Generation of the Firebase Android resource file google-services.xml ...」のエラーが出る場合の対処法

https://cdn-ak.f.st-hatena.com/images/fotolife/s/s_gozaru/20180326/20180326160955.png

Unityで作ったアプリにFirebaseを導入しているのですが、Firebaseを導入するとなぜか問題が多数出てくるように思います。今回は、Firebase導入時に発生したエラーに関する対処法のメモです。

 

【Unity】Firebaseで「Generation of the Firebase Android resource file google-services.xml ...」のエラーが出る場合の対処法

エラー内容は以下です。

Generation of the Firebase Android resource file google-services.xml from Assets/Plugins/GoogleService-Info.plist failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.

 Google翻訳にかけてみると以下です。

Assets /GoogleService-Info.plistからのFirebaseAndroidリソースファイルgoogle-services.xmlの生成に失敗しました。
アプリに有効なFirebaseAndroidリソースが含まれていない場合、初期化に失敗します。 

 一応、iOSAndroid用にFirebaseの設定ファイル「GoogleService-Info.plist」と「google-services.xml」をAssets/Plugins 以下に設置しているのですが、なぜか勝手に「GoogleService-Info.plist」から「google-services.xml」を生成しようとしてエラーになっている状態。

 

色々とネットを調べた結果、FIrebaseのプロジェクト管理画面で、「Realtime Database」というものの設定をオンにする必要があることがわかりました。

 

github.com

 

【Unity】Firebaseで「Generation of the Firebase Android resource file google-services.xml ...」のエラーが出る場合の対処法

「Realtime Database」未設定の場合、こんな感じの画面になるので、「データベースを作成」を選択して、手順に沿っていけば設定が完了します。

 

「Realtime Database」の設定完了後、再度Firebaseの設定ファイル「GoogleService-Info.plist」と「google-services.xml」をFirebaseの管理画面からダウンロードしてUnityプロジェクトに配置してビルドすればOK。

 

他のUnityプロジェクトでも同じようにFirebaseを導入しているのですが、なぜかこのプロジェクトだけこのエラーが出たのが謎です。(Firebaseバージョンの関係?)

 

 

 お知らせ

謎解き推理ゲーム「イラスト探偵」を最近リリースしました!

もしよろしければダウンロードお願い致します!

 

app-seed.com

イラスト探偵-謎解き推理ゲーム-

イラスト探偵-謎解き推理ゲーム-

  • AppSeed, Incorporated.
  • ゲーム
  • 無料

apps.apple.com

play.google.com

www.amazon.com