New Android App NullPointerException on first launch
sjug opened this issue · comments
What is the issue?
I updated my Tailscale app on my Android device. I had my other VPN app running and set to the "Always-on VPN" in the settings.
I tried to launch the Tailscale app after updating. It would crash immediately.
Steps to reproduce
- Have other VPN app running, connected, and set to always-on in settings.
- Update Tailscale app to 1.66.3 via Google Play Store.
- Launch Tailscale app (should try to start network automatically, if not start network manually).
- Crash.
Are there any recent changes that introduced the issue?
The recent change was the app rewrite/uprade.
OS
Android
OS version
14
Tailscale version
1.66.3-teae73f821-g63a2bbc8e71
Other software
Other VPN app
Bug report
BUG-a820be88a1be0ad8b0f78a2ee14193dcd3fec85e0988dad38e3496f127afd610-20240515172921Z-fb47fd784292be6f
Can you please run adb logcat
and provide us with the stack trace of the crash when it verifies? Thanks.
Will do, I have this crash handy but it wasn't from adb logcat
:
type: crash
osVersion: google/shiba/shiba:14/AP1A.240505.005/2024050700:user/release-keys
package: com.tailscale.ipn:219
process: com.tailscale.ipn
processUptime: 2610 + 378 ms
installer: com.android.vending
java.lang.NullPointerException: findFragmentByTag(...) must not be null
at com.tailscale.ipn.App$Companion.startActivityForResult(App.kt:66)
at com.tailscale.ipn.App.prepareVPN$lambda$1(App.kt:252)
at com.tailscale.ipn.App.$r8$lambda$L4xZtibjmMdlYIKm1rrO1TWKG94(Unknown Source:0)
at com.tailscale.ipn.App$$ExternalSyntheticLambda0.run(Unknown Source:6)
at android.app.Activity.runOnUiThread(Activity.java:7838)
at com.tailscale.ipn.App.prepareVPN(App.kt:245)
at com.tailscale.ipn.MainActivity$onCreate$2$1.emit(MainActivity.kt:237)
at com.tailscale.ipn.MainActivity$onCreate$2$1.emit(MainActivity.kt:235)
at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:392)
at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8532)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ExecInit.main(ExecInit.java:50)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5ab2506, Dispatchers.Main.immediate]
It also crashes if I try to connect the app while the other VPN is connected & enabled as always-on.
Looks like the new app is not handling that condition.
edit: This is the same stack trace I'm seeing in logcat. Please let me know if you want that output instead.
Thanks! This really helps.
cc @kari-ts
For those looking for a quick solution, clearing the app data and then re-logging in seemed to fix this for me.