FirebaseをUnityに導入したいです。
しかしこのようなエラーが出てしまいます。
発生している問題・エラーメッセージ
Unable to load Firebase app options ([C:/Users/famil/OneDrive/デスクトップ/test_for_firebase/Assets/StreamingAssets\google-services-desktop.json, C:/Users/famil/OneDrive/デスクトップ/test_for_firebase/Assets/StreamingAssets\google-services.json] are missing or malformed) UnityEngine.Debug:LogError(Object) Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) (at Z:/tmp/tmp.2EdHBeH7XL/firebase/app/client/unity/src/Unity/FirebaseLogger.cs:95) Firebase.LogUtil:LogMessage(LogLevel, String) (at Z:/tmp/tmp.NAnOUSwrsj/firebase/app/client/unity/proxy/LogUtil.cs:68) Firebase.LogUtil:LogMessageFromCallback(LogLevel, String) (at Z:/tmp/tmp.NAnOUSwrsj/firebase/app/client/unity/proxy/LogUtil.cs:76) Firebase.AppUtilPINVOKE:PollCallbacks() Firebase.AppUtil:PollCallbacks() (at Z:/tmp/tmp.NAnOUSwrsj/firebase/app/client/unity/proxy/AppUtil.cs:32) Firebase.Platform.FirebaseAppUtils:PollCallbacks() (at Z:/tmp/tmp.NAnOUSwrsj/firebase/app/client/unity/proxy/FirebaseAppUtils.cs:33) Firebase.Platform.FirebaseHandler:Update() (at Z:/tmp/tmp.2EdHBeH7XL/firebase/app/client/unity/src/Unity/FirebaseHandler.cs:205)
該当のソースコード
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using Firebase; 5using Firebase.Database; 6using Firebase.Unity.Editor; 7 8public class RealtimeDatabase : MonoBehaviour{ 9 10 11 void Start () { 12 Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { 13 var dependencyStatus = task.Result; 14 if (dependencyStatus == Firebase.DependencyStatus.Available) { 15 Firebase.FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://projectID.firebaseio.com"); 16 17 } else { 18 UnityEngine.Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}", dependencyStatus)); 19 // Firebase Unity SDK is not safe to use here. 20 } 21 }); 22 23 } 24 25 void Awake(){ 26 27 } 28 29 // Update is called once per frame 30 void Update() 31 { 32 33 } 34} 35
補足情報(FW/ツールのバージョンなど)
Unity 2019.3.6f
firebase_unity_sdk_6.13.0
あなたの回答
tips
プレビュー