我在 Unity3d 上尝试使用答案时遇到以下异常:
请注意,我使用 Fabric 的自动初始化,它可以与 Crashlytics 一起使用,但答案 - 不行。 (我正在调用Answers.LogCustom()函数并在应用程序启动后很长时间(确切地说是1分钟后)。
可以做些什么?
java.lang.IllegalStateException: Must Initialize Fabric before using singleton()
io.fabric.sdk.android.Fabric.singleton(Fabric.java:273)
io.fabric.sdk.android.Fabric.getKit(Fabric.java:524)
com.crashlytics.android.answers.Answers.getInstance(Answers.java:32)
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.c(Unknown Source)
com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source)
android.os.Handler.dispatchMessage(Handler.java:98)
android.os.Looper.loop(Looper.java:154)
com.unity3d.player.UnityPlayer$c.run(Unknown Source)
UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJNISafe.CallStaticObjectMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>:0)
UnityEngine.AndroidJavaObject._CallStatic[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0)
Fabric.Answers.Internal.AnswersSharedInstanceJavaObject..ctor () (at <00000000000000000000000000000000>:0)
Fabric.Answers.Internal.AnswersAndroidImplementation..ctor () (at <00000000000000000000000000000000>:0)
Fabric.Answers.Answers.get_Implementation () (at <00000000000000000000000000000000>:0)
Fabric.Answers.Answers.LogCustom (System.String eventName, System.Collections.Generic.Dictionary`2[TKey,TValue] customAttributes) (at <00000000000000000000000000000000>:0)