質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

0回答

417閲覧

実機でビルドするとRealtimeDataBaseのreferenceが参照できない

kimkim

総合スコア142

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2018/11/02 06:34

編集2018/11/03 16:05

前提

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のダウンロードし直し。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問