-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug] java.lang.IllegalStateException UnityPlayerGameActivity FirebaseApp was deleted #1156
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hey @UnwindGamesDeveloper, sorry for the delayed response here. Could you share with me what Firebase products are you using? Also is there any chance you could share steps to reproduce the behavior or a minimal reproducible example? It'll help speed up our investigation. Thanks! |
HI @argzdev , It's been a while , so haven't updated firebase sdk since (still on 12.4.1). What we want is to control the initialization of firebase (in our unity game )from C# side. Hence, wanted to remove node from manifest like this:
And on unity side , somthing like this:
#if SOME_PREPROCESSOR
#endif
When doing this at runtime we were getting this exception : java.lang.IllegalStateException: FirebaseApp was deleted |
Thanks for providing code snippets, @UnwindGamesDeveloper. So far, I'm unable to reproduce the same behavior. I used our Firebase quickstart Unity for Crashlytics and added the similar code snippet with your setup. The Firebase Console was able to display the crashes being sent from the app. I don't see any runtime issue of Code snippet I have is fairly similar to yours: <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application>
<provider android:name="com.google.firebase.provider.FirebaseInitProvider" android:authorities="com.google.firebase.unity.crashlytics.testapp.firebaseinitprovider" android:exported="false" tools:node="remove" />
<!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<!--Used when Application Entry is set to GameActivity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerGameActivity" android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.lib_name" android:value="game" />
</activity>
</application>
</manifest> public virtual void Start() {
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
dependencyStatus = task.Result;
if (dependencyStatus == DependencyStatus.Available) {
InitializeFirebase();
} else {
Debug.LogError(
"Could not resolve all Firebase dependencies: " + dependencyStatus);
}
});
}
void InitializeFirebase() {
Firebase.AppOptions appOptions = new Firebase.AppOptions
{
ApiKey = "AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxZQ",
AppId = "1:700000000000000:android:0000000000000002",
ProjectId = "xxxxx-xxxxxxx-xxxxxxx"
};
var app = Firebase.FirebaseApp.Create(appOptions);
firebaseInitialized = true;
} I'm currently using the latest version of Firebase |
@argzdev Yes , this exact same setup was leading to the issues mentioned earlier. Although i was on 12.4.1. I'll update to 12.5.0 and confirm on it again. Will update this in a while. |
In that case, there could be a different configuration that is causing this issue. If you're still encountering the issue, please provide us an MCVE so we can investigate this further. Thanks! |
Also additional info , which i forgot to add initially (My bad! ) is that this execption "java.lang.IllegalStateException: FirebaseApp was deleted." was never caught by crashlytics itself. We also have integrated Bugsnag as a secodary soruce for tracking exceptions . It was bugsnag which was catching this exception. |
Thanks for the additional info. That said, we still need an MCVE to investigate this further since we're unable to reproduce this behavior on our side. From my understanding, the error "java.lang.IllegalStateException: FirebaseApp was deleted" means that the default Firebase app instance already exist and is being replaced which causes to throw this issue. You could be running an instantiation code more than once. FYI, Firebase Analytics cannot function by manual instantiation. This is still an open feature request in our Firebase Android SDK repo. There are a couple of suggestion by other developers as alternative solution, however we don't have any official guide for that as of the moment. |
"From my understanding, the error "java.lang.IllegalStateException: FirebaseApp was deleted" means that the default Firebase app instance already exist and is being replaced which causes to throw this issue. You could be running an instantiation code more than once." Yeah from my end , will double check on this part as well. Also would give a thorough MCVE if i still encounter it. Thanks for quick responses @argzdev ! |
Description
Game Crashes at Launch some times.
Reproducing the issue
Firebase Unity SDK Version
12.4.1
Unity editor version
6000.0.27f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
No response
Other Firebase Component(s) in use
No response
Additional SDKs you are using
No response
Targeted Platform(s)
Android
Unity editor platform
Mac
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
Expand
Podfile.lock
snippet👀 Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: