Skip to content
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

New Android App NullPointerException on first launch #12148

Closed
sjug opened this issue May 15, 2024 · 6 comments · Fixed by tailscale/tailscale-android#398
Closed

New Android App NullPointerException on first launch #12148

sjug opened this issue May 15, 2024 · 6 comments · Fixed by tailscale/tailscale-android#398
Assignees
Labels

Comments

@sjug
Copy link

sjug commented May 15, 2024

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

  1. Have other VPN app running, connected, and set to always-on in settings.
  2. Update Tailscale app to 1.66.3 via Google Play Store.
  3. Launch Tailscale app (should try to start network automatically, if not start network manually).
  4. 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

@agottardo
Copy link
Contributor

agottardo commented May 15, 2024

Can you please run adb logcat and provide us with the stack trace of the crash when it verifies? Thanks.

@sjug
Copy link
Author

sjug commented May 15, 2024

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.

@agottardo
Copy link
Contributor

Thanks! This really helps.

cc @kari-ts

@tendstofortytwo
Copy link
Contributor

For those looking for a quick solution, clearing the app data and then re-logging in seemed to fix this for me.

kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 16, 2024
-show VPN connection permissions after intro screen
-make toggle state and main view take VPN preparedness into consideration

Fixes tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 16, 2024
-show VPN connection permissions after intro screen
-make toggle state and main view take VPN preparedness into consideration

Fixes tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 16, 2024
-show VPN connection permissions after intro screen
-make toggle state and main view take VPN preparedness into consideration

Fixes tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 16, 2024
-show VPN connection permissions after intro screen
-make toggle state and main view take VPN preparedness into consideration

Fixes tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 17, 2024
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 17, 2024
@kari-ts
Copy link
Contributor

kari-ts commented May 17, 2024

@sjug, thank you for the report and the logs - this goes such a long way towards helping us identify and fix issues, and we so appreciate it!

barnstar added a commit to tailscale/tailscale-android that referenced this issue May 17, 2024
Updates tailscale/tailscale#12148

There was a small bug where we weren't rechecking the
vpn permissions to the FUS would never show.  We'll
now do that in the view model base case on initialization.

Signed-off-by: Jonathan Nobels <[email protected]>
barnstar added a commit to tailscale/tailscale-android that referenced this issue May 17, 2024
Updates tailscale/tailscale#12148

There was a small bug where we weren't rechecking the
vpn permissions to the FUS would never show.  We'll
now do that in the view model base case on initialization.

Signed-off-by: Jonathan Nobels <[email protected]>
@sjug
Copy link
Author

sjug commented May 17, 2024

Happy to help, thanks for the quick triage @agottardo and turnaround @kari-ts.
Looking forward to the release getting pushed out.
The new Android app looks great, keep up the good work!

kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 28, 2024
#398 introduced a bug where we were not calling startVPN after getting (or confirming) VPN.prepare permissions
This resulted in the VPN not being turned on after logging in for the first time

Updates tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 29, 2024
-show VPN connection permissions after intro screen
-make toggle state and main view take VPN preparedness into consideration

Fixes tailscale/tailscale#12148

Signed-off-by: kari-ts <[email protected]>
kari-ts added a commit to tailscale/tailscale-android that referenced this issue May 29, 2024
kari-ts pushed a commit to tailscale/tailscale-android that referenced this issue May 29, 2024
Updates tailscale/tailscale#12148

There was a small bug where we weren't rechecking the
vpn permissions to the FUS would never show.  We'll
now do that in the view model base case on initialization.

Signed-off-by: Jonathan Nobels <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants