前提
unity editorでは参照されているのに、実機でビルドするとなぜか参照できません。
(以前は出来ていたのですが、何かをきっかけに出来なくなってしまいました...
何がきっかけだかはわかりません...)
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Firebase; using Firebase.Unity.Editor; using Firebase.Database; public class FirebaseManager : MonoBehaviour { DatabaseReference reference; public GameObject rankingSpace; void Start() { // Set up the Editor before calling into the realtime database. FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://<FirebaseのプロジェクトID>.firebaseio.com/"); // Get the root reference location of the database. reference = FirebaseDatabase.DefaultInstance.RootReference; Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { var dependencyStatus = task.Result; if (dependencyStatus == Firebase.DependencyStatus.Available) { // Create and hold a reference to your FirebaseApp, i.e. // app = Firebase.FirebaseApp.DefaultInstance; // where app is a Firebase.FirebaseApp property of your application class. // Set a flag here indicating that Firebase is ready to use by your // application. } else { UnityEngine.Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}", dependencyStatus)); // Firebase Unity SDK is not safe to use here. } }); Debug.Log("ref:"+reference); } }
発生している問題・エラーメッセージ
上記のコードをオブジェクトにアタッチして、UnityEditor上でビルドすると、しっかりreferenceが表示されます。
しかし、実機(iOS,Android)でビルドするとなぜだか何も表示されません。
エラーメッセージ
エラーメッセージはないのですが、
ログの中で気になったところを以下に書きます。
//1 2018-11-04 00:28:33.931490+0900 BoundBasket[15610:331408] ERROR: Unable to configure Firebase services: Google Analytics for Firebase version (50200000) does not match with Google App Measurement (50300000) version. Please update. Unable to configure Firebase services: Google Analytics for Firebase version (50200000) does not match with Google App Measurement (50300000) version. Please update. //2 InitializationException: Firebase app creation failed. at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <filename unknown>:0 at FirebaseManager.Start () [0x00000] in <filename unknown>:0 //3 2018-11-04 00:28:33.935251+0900 BoundBasket[15610:331408] [ADG][InADGGeolocationProvider startRecurringLocationUpdates][DEBUG] Location update is disabled. 2018-11-04 00:28:33.948722+0900 BoundBasket[15610:331408] [ADG][InADGGeolocationProvider startRecurringLocationUpdates][DEBUG] Location update is disabled. 2018-11-04 00:28:34.571395+0900 BoundBasket[15610:331443] [Client] Remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.} 2018-11-04 00:28:34.571396+0900 BoundBasket[15610:331408] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.} 2018-11-04 00:28:34.571615+0900 BoundBasket[15610:331408] [NetworkInfo] Descriptors query returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.app2018-11-04 00:28:34.571616+0900 BoundBasket[15610:331443] [Client] Remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.}
試したこと
・GoogleService-Info.plist
・google-services.json
のダウンロードし直し。
・DatabaseSDKのダウンロードし直し。
あなたの回答
tips
プレビュー