我的Android构建未能初始化Firebase Messaging,出现以下错误:
I/Unity (30673): InitializationException: Failed to read Firebase options from the app's resources. You'll need to either at least set App ID and API key or include google-services.json your app's resources.
I/Unity (30673): at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate) [0x00000] in <filename unknown>:0
I/Unity (30673): at Firebase.FirebaseApp.Create () [0x00000] in <filename unknown>:0
I/Unity (30673): at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0
I/Unity (30673): at Firebase.Messaging.FirebaseMessaging+Listener..ctor () [0x00000] in <filename unknown>:0
I/Unity (30673): at Firebase.Messaging.FirebaseMessaging+Listener.Create () [0x00000] in <filename unknown>:0
I/Unity (30673): at Firebase.Messaging.FirebaseMessaging..cctor () [0x00000] in <filename unknown>:0
I/Unity (30673): Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.Messaging.FirebaseMessaging
我已经下载并将google-services.json
文件放置在项目根目录中,生成了一个google-services.xml
文件,位于Plugins/Android/Firebase/res/values
,看起来包含所有必需的值。
如果运行Google Play Games包会有任何影响。 Unity 5.3和Firebase 4.1。过去曾经成功运行,但现在重新安装了软件包后无法工作。