joreilly / Confetti

KMP GraphQL based conference project with Jetpack Compose Android, Compose for Wear and SwiftUI iOS clients along with GraphQL backend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash during startup without network connection

SimonMarquis opened this issue · comments

Sometimes, when launching the app after a long period (probably leading to a cold start) while in airplane mode (or without network), the app crashes direclty.
I've been able to capture the stacktrace.
Unfortunately, it seems to be thrown from an internal thread of Firebase-auth SDK, making it somewhat hard to locate where it originates.

AndroidRuntime E  FATAL EXCEPTION: main
Process: dev.johnoreilly.confetti, PID: 7332
com.google.firebase.FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
	at com.google.android.gms.internal.firebase-auth-api.zzach.zza(com.google.firebase:firebase-auth@@22.3.1:15)
	at com.google.android.gms.internal.firebase-auth-api.zzadg.zza(com.google.firebase:firebase-auth@@22.3.1:21)
	at com.google.android.gms.internal.firebase-auth-api.zzacw.zza(com.google.firebase:firebase-auth@@22.3.1:35)
	at com.google.android.gms.internal.firebase-auth-api.zzacy.zza(com.google.firebase:firebase-auth@@22.3.1:75)
	at com.google.android.gms.internal.firebase-auth-api.zzacf.zza(com.google.firebase:firebase-auth@@22.3.1:46)
	at com.google.android.gms.internal.firebase-auth-api.zzyk.zza(com.google.firebase:firebase-auth@@22.3.1:3)
	at com.google.android.gms.internal.firebase-auth-api.zzadl.zza(com.google.firebase:firebase-auth@@22.3.1:70)
	at com.google.android.gms.internal.firebase-auth-api.zzacs.zza(com.google.firebase:firebase-auth@@22.3.1:48)
	at com.google.android.gms.internal.firebase-auth-api.zzyl.zzb(com.google.firebase:firebase-auth@@22.3.1:110)
	at com.google.android.gms.internal.firebase-auth-api.zzace.zzb(com.google.firebase:firebase-auth@@22.3.1:91)
	at com.google.android.gms.internal.firebase-auth-api.zzaar.zza(com.google.firebase:firebase-auth@@22.3.1:13)
	at com.google.android.gms.internal.firebase-auth-api.zzadi.run(com.google.firebase:firebase-auth@@22.3.1:2)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0$com-google-firebase-concurrent-CustomThreadFactory(CustomThreadFactory.java:47)
	at com.google.firebase.concurrent.CustomThreadFactory$$ExternalSyntheticLambda0.run(Unknown Source:4)
	at java.lang.Thread.run(Thread.java:1012)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@98fffde, Dispatchers.Main.immediate]

I'm almost sure this is the same as paug/AndroidMakersApp#302. Might be an issue with the gitlive KMP Firebase integration or maybe we need to catch that exception somewhere.

Looks like this firebase issue. I'll wrap the getIdToken() call in a try/catch

I've published new version to play store with this fix (internal test now but will hopefully promote to production soon)