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!

Ramesh sambu
  • 3,577
  • 2
  • 24
  • 39
  • Can you share code where you initialized fabric? – Ramesh sambu Dec 13 '17 at 12:57
  • Initialize crashlytics Fabric extending application or(in Main class) refer: https://stackoverflow.com/a/26539044/5018132 – S J Dec 13 '17 at 13:14
  • I'm using automatic initialization in Unity [https://docs.fabric.io/unity/crashlytics/installation.html](https://docs.fabric.io/unity/crashlytics/installation.html) And also tried using manual initialization [https://docs.fabric.io/unity/fabric/initialization.html](https://docs.fabric.io/unity/fabric/initialization.html) On Awake method – user1385416 Dec 13 '17 at 13:22
  • Are you using MultiDex? The Crashlytics Unity SDK doesn't currently support MultiDex and can lead to this error. – Alexizamerican Dec 13 '17 at 18:02
  • 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. – user1385416 Dec 13 '17 at 18:31
  • Does this happen on every run? – Alexizamerican Dec 14 '17 at 01:23

1 Answers1

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.