android-browser-helper
android-browser-helper copied to clipboard
Loop crash when no browser
Describe the bug We discovered an issue when using the CCT fallback strategy. The application crashes in a loop when no browser available.
To Reproduce Steps to reproduce the behavior:
- Open a TWA application on a device without any browser installed
- See error : stuck on the splashscreen and then crash
Expected behavior It should close the app gracefully and warn the user with a toast for example
Did this ever used to work Don't think so
Code Snippets
E/PackageIdentity: Could not get fingerprint for package.
android.content.pm.PackageManager$NameNotFoundException
at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:286)
at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:258)
at androidx.browser.trusted.PackageIdentityUtils$Api28Implementation.getFingerprintsForPackage(PackageIdentityUtils.java:85)
at androidx.browser.trusted.PackageIdentityUtils.getFingerprintsForPackage(PackageIdentityUtils.java:47)
at androidx.browser.trusted.Token.create(Token.java:63)
at com.google.androidbrowserhelper.trusted.TwaLauncher.launch(TwaLauncher.java:190)
Smartphone (please complete the following information):
- Device: Galaxy S21 5G
- OS: Android 12
- Browsers Installed : None
- android-browser-helper library version : 2.3.0
Oh wow, that's impressive - how did you manage to get a device with no browser installed whatsoever?
I think we had always assumed that there would be some browser on the device.
Simply disabled them using adb :) But yeah, it should not happen frequently It's not an high priority bug I know, I just saw this behaviour and shared it :)
Close the issue if you want ;)