Fabric Crashlytics (Unity - Android): Fabric did not find a valid application context
Asked Answered
B

1

0

I'm trying to add Fabric Crashlytics to Unity targeted to iOS / Android devices. For iOS, it's working fine but Android is crashing initializing Crashlytics.

I didn't find much on the internet about this issue. Any suggestions?

AndroidJavaException: >io.fabric.unity.android.FabricInitializationException: Fabric did not find a valid application context. ? 12-13 00:13:28.758 24477 24516 E Unity : io.fabric.unity.android.FabricInitializationException: Fabric did not find a valid application context. 12-13 00:13:28.758 24477 24516 E Unity : at io.fabric.unity.android.FabricInitializer.initializeFabric(FabricInitializer.java:33) 12-13 00:13:28.758 24477 24516 E Unity : at io.fabric.unity.android.FabricInitializer.JNI_InitializeFabric(FabricInitializer.java:26) 12-13 00:13:28.758 24477 24516 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 12-13 00:13:28.758 24477 24516 E Unity : at com.unity3d.player.UnityPlayer.c(Unknown Source) 12-13 00:13:28.758 24477 24516 E Unity : at com.unity3d.player.UnityPlayer$c$1.handleMessage(Unknown Source) 12-13 00:13:28.758 24477 24516 E Unity : at android.os.Handler.dispatchMessage(Handler.java:98) 12-13 00:13:28.758 24477 24516 E Unity : at android.os.Looper.loop(Looper.java:158) 12-13 00:13:28.758 24477 24516 E Unity : at com.unity3d.player.UnityPlayer$c.run(Unknown Source) 12-13 00:13:28.758 24477 24516 E Unity : at UnityEngine.AndroidJNISafe.CheckException () [0x0008c] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:24

Thank you all!

Bamberg answered 13/12, 2017 at 12:56 Comment(6)
Can you share code where you initialized fabric?Soerabaja
Initialize crashlytics Fabric extending application or(in Main class) refer: https://mcmap.net/q/244493/-how-to-initialize-crashlytics-in-fabric-ioHexa
I'm using automatic initialization in Unity https://docs.fabric.io/unity/crashlytics/installation.html And also tried using manual initialization https://docs.fabric.io/unity/fabric/initialization.html On Awake methodBamberg
Are you using MultiDex? The Crashlytics Unity SDK doesn't currently support MultiDex and can lead to this error.Orderly
I don't even now what MultiDex is! jeje. Could be something that Firebase change automagically? I have Firebase for auth and database and Fabric for Crashlytics.Bamberg
Does this happen on every run?Orderly
B
2

Hi I just wanted to add the answer in case someone else run in the same issue.

In my case the solution was set up automatic installation of Fabric components and in the "Editor Default Resources" folder you will see a file called "FabricSettings" select that file and in the inspector expand "Installed Kits" and "Crashlytics" you will see two checkbox "installed" and "enabled".

For some reason "installed" was not checked in my setup so I only change that value and it started to work :).

Thanks for you responses.

Bamberg answered 14/12, 2017 at 12:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.