android-browser-helper icon indicating copy to clipboard operation
android-browser-helper copied to clipboard

Loop crash when no browser

Open dalexanco opened this issue 3 years ago • 2 comments

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:

  1. Open a TWA application on a device without any browser installed
  2. 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

dalexanco avatar Jan 05 '22 15:01 dalexanco

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.

PEConn avatar Jan 11 '22 11:01 PEConn

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 ;)

dalexanco avatar Feb 03 '22 10:02 dalexanco