0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Unityでgoogle-signin-unityとFirebase SDKを共存させてAndroidビルドする方法のメモ

Posted at

はじめに

前回 Firebase AuthのGoogle認証をする方法 の記事を書きましたが、記事中の状態でFirebaseFirestoreをインポートしたところエラーが出たので、少し回りくどいですがその対処法を備忘録も兼ねてまとめます。

使用するツール

Unity 2021.1.26f1
google-signin-plugin-1.0.4 (google-signin-unity)
firebase_unity_sdk_8.4.0

google-signin-unityのインポート

前回 と同様にインポートします。エラーが出る場合は GitHub を参照してください。

Firebase SDKのインポート

google-signin-unityをインポートしたプロジェクトとは別で新規のUnityプロジェクトを作成し、必要なSDKをインポートします。前回 の手順 3. 4. と同様にファイルの操作を行います。
flysakiさんの記事 の通りに設定を変更します。External Dependency Manager から Android Resolver と Version Handler を実行し、Androidビルドが成功したら完了です。

google-signin-unityとFirebaseを統合

両者どちらも Assets/ 内にある ExternalDependencyManager を削除します。それぞれバージョンが異なるため、2つを統合した状態で Resolver を実行すると Plugins/Android/ 内のファイルが壊れます。
その後、両者のプロジェクトの Assets/ 内を統合します。Parse/ は Firebase の方を優先してください。

おわりに

この状態でビルドしても、Firebase.Editor云々のエラーが出てビルドに失敗する場合があります。Unity Editorを開きっぱなしで何度かビルドを繰り返すと成功することがあります。
もしこれよりもいい方法があれば教えてください。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?