Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Documentation: Can't recreate default Firebase App #890

Open
@kvanry

Description

Describe your environment

  • Android Studio version: 3.4.2
  • Firebase Component: Database
  • Component version: 19.1.0

Describe the problem

Caused by java.lang.IllegalStateException
FirebaseApp was deleted
com.google.android.gms.common.internal.Preconditions.checkState (Preconditions.java:9)
com.google.firebase.FirebaseApp.checkNotDeleted (FirebaseApp.java:509)
com.google.firebase.FirebaseApp.getName (FirebaseApp.java:182)
com.google.firebase.auth.internal.zzv.<init> (zzv.java:54)
com.google.firebase.auth.internal.zzas.<init> (zzas.java:6)
com.google.firebase.auth.FirebaseAuth.zzct (FirebaseAuth.java:9)
com.google.firebase.auth.FirebaseAuth.addIdTokenListener (FirebaseAuth.java:8)
com.google.firebase.database.android.AndroidAuthTokenProvider1ドル.addTokenChangeListener (AndroidAuthTokenProvider.java:57)
com.google.firebase.database.core.Repo.deferredInitialization (Repo.java:110)
com.google.firebase.database.core.Repo.access000ドル (Repo.java:56)
com.google.firebase.database.core.Repo1ドル.run (Repo.java:95)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:458)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:301)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:764)

And

Fatal Exception: java.lang.RuntimeException
Uncaught exception in Firebase Database runloop (3.0.0). Please report to firebase-database-client@google.com
com.google.firebase.database.android.AndroidPlatform1ドル1ドル.run (AndroidPlatform.java:96)
android.os.Handler.handleCallback (Handler.java:873)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:205)
android.app.ActivityThread.main (ActivityThread.java:6983)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:884)

Steps to reproduce:

We haven't been able to pinpoint how this is occuring, however our setup is we dynamically can switch between firebase environments. We've spent a few days trying to replicate, unfortunately only our customers are finding this issue.

Relevant Code:

 private fun updateFirebase(environment: Environment) {
 firebaseApp?.delete()
 when (environment) {
 Environment.Unknown,
 Environment.NotSet -> { /* We don't need to do anything here */
 return
 }
 Environment.Dev -> {
 FirebaseApp.initializeApp(context, AppConfiguration.instance.firebaseDev)
 }
 Environment.Staging -> {
 FirebaseApp.initializeApp(context, AppConfiguration.instance.firebaseStage)
 }
 Environment.Prod -> {
 FirebaseApp.initializeApp(context, AppConfiguration.instance.firebaseProd)
 }
 Environment.Europe -> {
 FirebaseApp.initializeApp(context, AppConfiguration.instance.firebaseEurope)
 }
 }
 
 FirebaseDatabase.getInstance().setPersistenceEnabled(false)
 }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /