Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InitializationException: Crashlytics initialization failed. Could not find Crashlytics initializer. #623

Closed
Unarmed1000 opened this issue Mar 27, 2020 · 32 comments
Labels
closed-by-bot needs-info Need information for the developer stale Don't have recent activity

Comments

@Unarmed1000
Copy link

@Unarmed1000 Unarmed1000 commented Mar 27, 2020

Please fill in the following fields:

Unity editor version: 2018.4.19f1
Firebase Unity SDK version: 6.13.0
Firebase plugins in use (Auth, Database, etc.): Core, Analytics, Crashlytics, RemoteConfig
Additional SDKs you are using (Facebook, AdMob, etc.): Admob
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:

Upgraded project from 6.9.0 which worked.
Using firebase core, analytics, Crashlytics, RemoteConfig from the package manager.

As a workaround I tried manually installing it but here I get a editor warning about crashlytics instead.

This is the log from the package manager based install:

2020-03-27 10:56:07.106 1718-1855/? I/Unity: Firebase Analytics API Initializing
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.107 1718-1855/? I/Unity: analytics API Initialized
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.107 1718-1855/? I/Unity: Remote Config API Initialized
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.160 1718-1855/? I/Unity: Firebase Analytics API Initializing
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.161 1718-1855/? I/Unity: analytics API Initialized
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.167 1718-1855/? I/Unity: Remote Config API Initialized
     
    (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
2020-03-27 10:56:07.179 1718-1855/? E/Unity: InitializationException: Crashlytics initialization failed. Could not find Crashlytics initializer.
      at Firebase.FirebaseApp.InitializeCrashlyticsIfPresent () [0x00000] in <00000000000000000000000000000000>:0 
      at Firebase.FirebaseApp.CreateAndTrack (Firebase.FirebaseApp+CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <00000000000000000000000000000000>:0 
      at MB.Unity.SafeBoot.Items.SafeBootFirebase.TryCheckFirebaseTaskCompleted (System.Threading.Tasks.Task`1[TResult] task) [0x00000] in <00000000000000000000000000000000>:0 
      at MB.Unity.SafeBoot.Items.SafeBootFirebase.OnFirebaseCheckWait () [0x00000] in <00000000000000000000000000000000>:0 
      at MB.Unity.SafeBoot.Items.SafeBootFirebase.Process () [0x00000] in <00000000000000000000000000000000>:0 
      at MB.Unity.SafeBoot.SafeBootManager.Process () [0x00000] in <00000000000000000000000000000000>:0 
      at MB.Unity.SafeBoot.SafeBootManager.Update (System.Single deltaTime) [0x00000] in <00000000000000000000000000000000>:0 
      at M

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?

Unfortunately no. But two projects that worked with 6.9.0 produce this error.

What's the issue repro rate? 100%

@Unarmed1000 Unarmed1000 added the new New issue. label Mar 27, 2020
@Vahe999
Copy link

@Vahe999 Vahe999 commented Mar 27, 2020

I have the same problem.

Unity editor version: 2018.4.18f1
Firebase Unity SDK version: 6.13.0
Firebase plugins in use (Auth, Database, etc.): Core, Analytics, Crashlytics, RemoteConfig
Additional SDKs you are using (Facebook, AdMob, etc.): MaxSDK
Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac
Platform you are targeting (iOS, Android, and/or desktop): iOS
Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:
Upgraded project from 6.9.0 which worked.
iOS Build at start crashed.

CrashReporter: initialized
2020-03-27 17:21:06.880816+0400 catstower2[9709:1430152] [Crashlytics] Version 3.13.4 (143)
InitializationException: Crashlytics initialization failed. Could not find Crashlytics initializer.
  at Firebase.FirebaseApp.InitializeCrashlyticsIfPresent () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.set_IsCrashlyticsCollectionEnabled (System.Boolean value) [0x00000] in <00000000000000000000000000000000>:0 
tionException: Crashlytics initialization failed with an unexpected error.
  at Firebase.FirebaseApp.InitializeCrashlyticsIfPresent () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.set_IsCrashlyticsCollectionEnabled (System.Boolean value) [0x00000] in <00000000000000000000000000000000>:0 
: The type initializer for 'Firebase.Crashlytics.Crashlytics.PlatformAccessor' threw an exception.
  at Firebase.Crashlytics.Crashlytics.set_IsCrashlyticsCollectionEnabled (System.Boolean value) [0x00000] in <00000000000000000000000000000000>:0 

@gevorgyanmp
Copy link

@gevorgyanmp gevorgyanmp commented Mar 27, 2020

I have this problem too

Using Unity editor version: 2018.4.18f1
Firebase Unity SDK version: 6.13.0

@chkuang-g
Copy link
Contributor

@chkuang-g chkuang-g commented Mar 30, 2020

@Vahe999 @gevorgyanmp
Did you installed Firebase through Unity Package Manager as well?

@gevorgyanmp Which platform did you see the issue? Could you provide more detail about this?

I suspect that Crashlytics editor tool might failed to resolve Xcode project or AndroidManifest.xml when it is installed through Unity Package Manager. If this issue is blocking your project, I would recommend to install unitypackage version of Firebase SDK before we fix the issue.

Thank you for reporting this.
Shawn

@chkuang-g chkuang-g added type: bug and removed new New issue. labels Mar 30, 2020
@Vahe999
Copy link

@Vahe999 Vahe999 commented Mar 31, 2020

@chkuang-g "Did you installed Firebase through Unity Package Manager as well?" -> Yes

@MagicMiikka
Copy link

@MagicMiikka MagicMiikka commented Apr 3, 2020

We also are experiencing the same issue.

Unity 2018.4.18f1
JarResolver migrated to EDM4U in Package Manager
Cleaned up FireBase and JarResolver with EDM4U tool.
FireBase 6.13.0 (from 6.9.0) from Package Manager

@TheEye2108
Copy link

@TheEye2108 TheEye2108 commented Apr 3, 2020

Same error same SDK version only Unity 2018.4.20f1

@drallcom3
Copy link

@drallcom3 drallcom3 commented Apr 6, 2020

Yep, UPM version doesn't initialize Crashlytics (maybe even all of Firebae) in the build.

@vengefullfoot
Copy link

@vengefullfoot vengefullfoot commented Apr 6, 2020

Same issue with Unity 2019.3.7 and Firebase 6.13 from package manager

@TheEye2108
Copy link

@TheEye2108 TheEye2108 commented Apr 6, 2020

Yep, UPM version doesn't initialize Crashlytics (maybe even all of Firebae) in the build.

For us everything else works fine. Just installing the crashlytics sdk using .unitypackage

@Vahe999
Copy link

@Vahe999 Vahe999 commented Apr 6, 2020

Yep, UPM version doesn't initialize Crashlytics (maybe even all of Firebae) in the build.

For us everything else works fine. Just installing the crashlytics sdk using .unitypackage

crashlytics sdk? What you talking about? Give us the link.

@sdegetaus
Copy link

@sdegetaus sdegetaus commented Apr 6, 2020

I have this exact problem! Unity 2019.3.3f1, IL2CPP, Firebase 6.13.0 from External Dependencies (unity-jar-resolver).

UPDATE

When I build with Engine Code Stripping, my game crashes on startup (right after splashscreen). Without it, it gives me this thread's error. Not sure if these are related.

This is the error from Android Studio's Logcat:
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4a in tid 31582 (UnityMain), pid 31526 (company.name)

@TheEye2108
Copy link

@TheEye2108 TheEye2108 commented Apr 7, 2020

Yep, UPM version doesn't initialize Crashlytics (maybe even all of Firebae) in the build.

For us everything else works fine. Just installing the crashlytics sdk using .unitypackage

crashlytics sdk? What you talking about? Give us the link.

In the Step 4: Add Firebase Unity SDKs/Manual Install here is the link: https://firebase.google.com/docs/unity/setup

@sdegetaus
Copy link

@sdegetaus sdegetaus commented Apr 8, 2020

I have now made it work for myself, with or without Code Stripping 🎉 I added an XML file called link.xml to my project's root directory and added this code to it:

// link.xml
<linker>
   
  <assembly fullname="Firebase.Crashlytics" ignoreIfMissing="1">
    <namespace fullname="Firebase.Crashlytics" preserve="all"/>
  </assembly>

  <assembly fullname="Firebase.App" ignoreIfMissing="1">
    <namespace fullname="Firebase.App" preserve="all"/>
  </assembly>
  
</linker>

Somehow, either the Crashlytics or the Firebase App were missing. It might have something to do with what the documentation says:

Note that link.xml files are not supported inside packages, but you can reference package assemblies from non-package link.xml files.

If this made it work for you too, do notify me, so I can be sure this was the problem! 🙂

@antonlicht
Copy link

@antonlicht antonlicht commented Apr 9, 2020

I have now made it work for myself, with or without Code Stripping 🎉 I added an XML file called link.xml to my project's root directory and added this code to it:

// link.xml
<linker>
   
  <assembly fullname="Firebase.Crashlytics" ignoreIfMissing="1">
    <namespace fullname="Firebase.Crashlytics" preserve="all"/>
  </assembly>

  <assembly fullname="Firebase.App" ignoreIfMissing="1">
    <namespace fullname="Firebase.App" preserve="all"/>
  </assembly>
  
</linker>

Somehow, either the Crashlytics or the Firebase App were missing. It might have something to do with what the documentation says:

Note that link.xml files are not supported inside packages, but you can reference package assemblies from non-package link.xml files.

If this made it work for you too, do notify me, so I can be sure this was the problem! 🙂

Fixed the issue for me too. Thank you :)

@kobyle69
Copy link

@kobyle69 kobyle69 commented Apr 21, 2020

Didn't work for me, same issue.

@kyriuch
Copy link

@kyriuch kyriuch commented Apr 21, 2020

Didn't work for me as well.

@eladleb
Copy link

@eladleb eladleb commented Apr 24, 2020

Same issue here.
It would have been so much better if the firebase team would simply update the releases page with known issues such as this one. So much time is wasted for nothing... :(

@eladleb
Copy link

@eladleb eladleb commented Apr 26, 2020

Does anyone know if this was resolved with Crashlytics 6.14?

@kyriuch
Copy link

@kyriuch kyriuch commented Apr 26, 2020

Using *.unitypackage instead of Package Manager helped in my case.

@AnnMic
Copy link

@AnnMic AnnMic commented Apr 29, 2020

Had the same issue as well. Installed from package manager. version 6.14 did not resolve the issue. The link.xml file mentioned above solved the issue.

@eladleb
Copy link

@eladleb eladleb commented Apr 30, 2020

Thanks @AnnMic, I also installed from package manager and the link.xml solved the issue.
Just a couple of clarifications that may be obvious but I thought worth mentioning:

  1. The link.xml should be in the project's assets folder.
  2. The first line (// link.xml) in the above code snippet shouldn't be copy-pasted into the XML.

@tiagomartines11
Copy link

@tiagomartines11 tiagomartines11 commented Apr 30, 2020

File com.google.firebase.crashlytics@6.14.0/Firebase/Plugins/Crashlytics/link.xml is ignored by Unity, and it is critical in order to make it work on games that use code stripping.

Link.xml files are ignored on UPM packages (read more).

Ideally, Crashlytics will update their code to include [Preserve] attributes on critical code. (read more).

@brzaknemanja
Copy link

@brzaknemanja brzaknemanja commented May 6, 2020

We've been stuck with this crashlytics issues for days. Not being able to see crashlytics reports on firebase console. What fixed this issue:

  1. Added link.xml file to root folder (Asset). Because as @tiagomartines11 mentioned, firebase adds link.xml file with PackageManager, but it's under Packages folder and it's ignored.
  2. Do not call crashlytics logs or exceptions right after firebase init. For some reason it was ignored until I added button in game when it's fully loaded. Only then was this error shown "InitializationException: Crashlytics initialization failed. Could not find Crashlytics initializer."

Also, 15mins passed until crash was shown on firebase console.

Firebase should really fix this issue. Our update was delayed for days because of this issue. This is just unacceptable..

@brzaknemanja
Copy link

@brzaknemanja brzaknemanja commented May 6, 2020

Also, in order to see crash logs in firebase console, you need to close app after you reproduce crash and kills process. After that, enter the app again. Somewhere in firebase doc it says that reports are sent after re-entering app.

@thiagolr
Copy link

@thiagolr thiagolr commented May 7, 2020

Does anyone know if we should also add the other firebase packages used to the link.xml file? For example: analytics and messaging

@tiagomartines11
Copy link

@tiagomartines11 tiagomartines11 commented May 7, 2020

From the packages I use, only Crashlytics had a link.xml.
You can check your setup by looking for link.xml files in your /Library/PackageCache folder.
E.g.

ᐅ find Library/PackageCache -name "link.xml"
Library/PackageCache/com.google.firebase.crashlytics@6.14.0/Firebase/Plugins/Crashlytics/link.xml

@brzaknemanja
Copy link

@brzaknemanja brzaknemanja commented May 11, 2020

Does anyone know if we should also add the other firebase packages used to the link.xml file? For example: analytics and messaging

I added remote config and analytics to project, but didn't add them to link.xml and everything works. I think it's only needed for crashlyltics.

@mrichards
Copy link

@mrichards mrichards commented May 20, 2020

Firebase engineer here. There was indeed a bug on the Android side when using Crashlytics via the Unity Package Manager. That will be fixed in the next release.

I have not been able to reproduce the error on iOS, even with Code Stripping enabled. So I cannot confirm that a fix will be in with the next release. The error message is consistent with a failure for Firebase to be properly initialized according to the Confirm Google Play Version step of the setup instructions. Can folks who have seen this error confirm that Firebase has been initialized successfully in the continuation?

@NielsGroep
Copy link

@NielsGroep NielsGroep commented Jun 9, 2020

Seeing in the 1.6.15 release notes that it should be fixed now?
https://firebase.google.com/support/release-notes/unity
"Prevented stripping of Crashlytics code by the UnityLinker."

@DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Jun 12, 2020

Hi @NielsGroep,

Yes, a fix for the Android version was released with 6.15. The team wasn't able to reproduce the iOS issue, but it may be fixed as well.

I'm going to remove the bug tag and request more information. Please confirm if the fix successfully solves the issue and respond here with whatever results you get. Thanks!

@DellaBitta DellaBitta added needs-info Need information for the developer and removed type: bug labels Jun 12, 2020
@google-oss-bot google-oss-bot added the stale Don't have recent activity label Jun 19, 2020
@google-oss-bot
Copy link

@google-oss-bot google-oss-bot commented Jun 19, 2020

Hey @Unarmed1000. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

@google-oss-bot google-oss-bot commented Jun 26, 2020

Since there haven't been any recent updates here, I am going to close this issue.

@Unarmed1000 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-by-bot needs-info Need information for the developer stale Don't have recent activity
Projects
None yet
Development

No branches or pull requests