我有一个Unity游戏,我在其中使用Firebase消息服务来发送推送通知。
我正在使用Firebase Unity SDK 3.0.3版
它可以在我的Galaxy S7上运行,但是当我在运行Android 4.1.2的S2上尝试时,Firebase会在我初始化时抛出异常。
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
当我调用上面的代码
时,以下是来自logcat(adb logcat -s Unity)的日志I/Unity ( 8751): Firebase App initializing app com.ARTEFICER.fruitfall (default 1).
I/Unity ( 8751): InitializationException: Firebase modules failed to initialize: messaging (missing dependency)
I/Unity ( 8751): at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate) [0x00000] in <filename unknown>:0
I/Unity ( 8751): at Firebase.FirebaseApp.Create () [0x00000] in <filename unknown>:0
I/Unity ( 8751): at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0
I/Unity ( 8751): at Firebase.Messaging.FirebaseMessaging+Listener..ctor () [0x00000] in <filename unknown>:0
I/Unity ( 8751): at Firebase.Messaging.FirebaseMessaging+Listener.Create () [0x00000] in <filename unknown>:0
I/Unity ( 8751): at Firebase.Messaging.FirebaseMessaging..cctor () [0x00000] in <filename unknown>:0
I/Unity ( 8751): Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.Messaging.FirebaseMessaging
I/Unity ( 8751): at FireBaseSetup.Start () [0x00000] in <filename unknown>:0
Firebase的最低API级别显然是14.上面的4.1.2。