You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is related to #1180. I have managed to reproduce a crash 100% of the time using the following steps. In our project, if we include a class (CrashMethods.cs) that is not referenced by any other code, the app crashes on an Android 15 emulator during Firebase initialization—specifically, the callback from CheckAndFixDependenciesAsync() is never received, and the app subsequently crashes with a native error. Removing CrashMethods.cs (or ensuring that both CrashMethods1() and CrashMethods2() are completely removed) prevents the crash.
Notably, even if only one of the methods in CrashMethods.cs remains, the crash occurs. I have verified this in a completely new project as well, so it appears to be a direct interaction that triggers the crash. Additionally, when the project that crashes in Unity 2022 was opened in Unity6 (6000.0.35f1) and built, the crash still occurred.
Reproducing the issue
Create a new 3D project in Unity 2022.3.23f1 (using Built-in Rendering).
Add google-services.json to the project (downloaded from the Firebase Console).
Import FirebaseMessaging.unitypackage into the project.
Switch the platform to Android in Build Settings.
In the Firebase settings, enable Auto Resolution.
In gradleTemplate.properties, add the following line to work around a Gradle build error:
Create Initializer.cs and attach it to an object in the scene.
Create CrashMethods.cs and place it in the Assets folder (do not reference this class anywhere).
Build and run the project on an Android 15 emulator.
Expected behavior:
The log "Call CheckAndFixDependenciesAsync" is output.
No log "CallBack CheckAndFixDependenciesAsync" is output, indicating that CheckAndFixDependenciesAsync() never returns.
The app crashes with a native error shortly thereafter.
Note:
If CrashMethods.cs is removed entirely from the project, the crash does not occur.
If either CrashMethods1() or CrashMethods2() remains (i.e., the file is not completely removed), the crash still occurs.
Code Samples:
Initializer.cs:
usingSystem.Collections;usingSystem.Collections.Generic;usingFirebase;usingFirebase.Extensions;usingUnityEngine;publicclassinitializer:MonoBehaviour{privateFirebaseAppapp;voidStart(){Debug.Log("Call CheckAndFixDependenciesAsync");
#if UNITY_ANDROID&&!UNITY_EDITORFirebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>{Debug.Log("CallBack CheckAndFixDependenciesAsync");vardependencyStatus=task.Result;if(dependencyStatus==Firebase.DependencyStatus.Available){// Create and hold a reference to your FirebaseApp,// where app is a Firebase.FirebaseApp property of your application class.app=Firebase.FirebaseApp.DefaultInstance;// Set a flag here to indicate whether Firebase is ready to use by your app.}else{UnityEngine.Debug.LogError(System.String.Format("Could not resolve all Firebase dependencies: {0}",dependencyStatus));// Firebase Unity SDK is not safe to use here.}});
#endif
}}
Hey @b3lypscfcon, thanks for bringing this to our attention again. I've escalated this issue during our engineering sync, and we're currently still in progress with the investigation. We'll post back here once we have updates to share. Thanks!
Description
This issue is related to #1180. I have managed to reproduce a crash 100% of the time using the following steps. In our project, if we include a class (
CrashMethods.cs
) that is not referenced by any other code, the app crashes on an Android 15 emulator during Firebase initialization—specifically, the callback fromCheckAndFixDependenciesAsync()
is never received, and the app subsequently crashes with a native error. RemovingCrashMethods.cs
(or ensuring that bothCrashMethods1()
andCrashMethods2()
are completely removed) prevents the crash.Notably, even if only one of the methods in
CrashMethods.cs
remains, the crash occurs. I have verified this in a completely new project as well, so it appears to be a direct interaction that triggers the crash. Additionally, when the project that crashes in Unity 2022 was opened in Unity6 (6000.0.35f1) and built, the crash still occurred.Reproducing the issue
google-services.json
to the project (downloaded from the Firebase Console).FirebaseMessaging.unitypackage
into the project.gradleTemplate.properties
, add the following line to work around a Gradle build error:Initializer.cs
and attach it to an object in the scene.CrashMethods.cs
and place it in the Assets folder (do not reference this class anywhere).CheckAndFixDependenciesAsync()
never returns.CrashMethods.cs
is removed entirely from the project, the crash does not occur.CrashMethods1()
orCrashMethods2()
remains (i.e., the file is not completely removed), the crash still occurs.Code Samples:
Initializer.cs:
CrashMethods.cs:
Environment:
Thank you for your attention to this matter. I look forward to your updates regarding this persistent crash.
Firebase Unity SDK Version
11.9.0, 12.5.0, 12.6.0
Unity editor version
2022.3.23f1, 6000.0.35f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
Messaging
Other Firebase Component(s) in use
No response
Additional SDKs you are using
No response
Targeted Platform(s)
Android
Unity editor platform
Windows
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
Relevant Log Output
If using CocoaPods for Apple platforms, the project's Podfile.lock
The text was updated successfully, but these errors were encountered: