Anki-Android
Anki-Android copied to clipboard
[Bug] Crash on changing themes
Reproduction Steps
- Open DeckPicker
- Settings - Themes - Set Theme
- Select a theme + close
Expected Result
- no crash
Actual Result
- crash
Debug info
2022-08-07 11:53:32.619 12126-12126/com.ichi2.anki E/CoroutineHelpersKt$launchCatchingTask: caught: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=SupervisorJobImpl{Cancelling}@b482daf
2022-08-07 11:53:32.636 12126-12126/com.ichi2.anki E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ichi2.anki, PID: 12126
android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@2124085 is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:1189)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:400)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:138)
at android.app.Dialog.show(Dialog.java:348)
at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1009)
at com.ichi2.anki.CoroutineHelpersKt.showError(CoroutineHelpers.kt:64)
at com.ichi2.anki.CoroutineHelpersKt.access$showError(CoroutineHelpers.kt:1)
at com.ichi2.anki.CoroutineHelpersKt$launchCatchingTask$1.invokeSuspend(CoroutineHelpers.kt:54)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:233)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@1e95316, Dispatchers.Main.immediate]
AnkiDroid Version = 2.16alpha76
Android Version = 12
Manufacturer = Google
Model = sdk_gphone64_arm64
Hardware = ranchu
Webview User Agent = Mozilla/5.0 (Linux; Android 12; sdk_gphone64_arm64 Build/S2B2.211203.006; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Mobile Safari/537.36
ACRA UUID = ecb3e9e6-0767-4815-b0e8-8fecadf4c3e5
Scheduler = std2
Crash Reports Enabled = false
DatabaseV2 Enabled = true
Research
- [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
- [x] I have checked the manual and the FAQ and could not find a solution to my issue
- [x] I have searched for similar existing issues here and on the user forum
- [x] (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)