shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.33k stars 141 forks source link

fix: `shorebird preview` fails for some phones #1740

Open MonkeyDoDev opened 8 months ago

MonkeyDoDev commented 8 months ago

App ID: 130984c0-a89c-44a0-972b-f29f9725b216

Description

When attempting to preview on my android physical device i receive the following error and the process appears to abort. HOWEVER - The app does in-fact install and can be opened manually by clicking the icon.

Which release would you like to preview? 1.1.55+73
✓ Using production track (0.5s)
✓ Extracting metadata (0.2s)
✓ Building apks (3.6s)
✓ Installing apks (8.5s)
✗ Exception: Unable to clear app data: 
Exception occurred while executing 'clear':
java.lang.SecurityException: PID 28278 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package dev.monkeydo.buck_the_critics
        at com.android.server.am.ActivityManagerService.clearApplicationUserData(ActivityManagerService.java:4170)
        at com.android.server.pm.PackageManagerShellCommand.runClear(PackageManagerShellCommand.java:2347)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:278)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onShellCommand(PackageManagerService.java:6381)
        at android.os.Binder.shellCommand(Binder.java:1073)
        at android.os.Binder.onTransact(Binder.java:901)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4313)
        at com.android.server.pm.PackageManagerService$IPackageManagerImpl.onTransact(PackageManagerService.java:6365)
        at android.os.Binder.execTransactInternal(Binder.java:1331)
        at android.os.Binder.execTransact(Binder.java:1268)

The

Steps To Reproduce

  1. create android release
  2. run 'shorebird preview android' from the terminal

Expected Behavior

The preview build to compile and install without error and for the application to open automatically

bryanoltman commented 7 months ago

From https://github.com/shorebirdtech/shorebird/issues/1789:

The original design goal of adding this to shorebird preview was to reset the app back to a "fresh from store" state (no patches installed). But it may not be possible to do that on some phones. I guess one thing we could do is catch this error and explain it to the dev.

AbhijithKonnayil commented 7 months ago

Does this means that, shorebird will not work on x86 or devices with this error ?

eseidel commented 7 months ago

Does this means that, shorebird will not work on x86 or devices with this error ?

Shorebird does not currently support x86 devices (since Flutter doesn't support x86 devices in release mode). Shorebird does support x64, arm7 (32bit) and arm64 on Android as well as arm64 on iOS.