2

I upgraded my flutter from 1.5.4-hotfix.2 to 1.7.8+hotfix.3 which report an error during the build.

The error reported was first experience on my current app. I then decided to create a new app (the default flutter app). I compiled it and got the same error. I added the requesting permission to the android manifest, but it did not work. For context it works fine on ios by the way.

This is the output with the error:

Launching lib/main.dart on SM J701M in debug mode... Built build/app/outputs/apk/debug/app-debug.apk.

Security exception: Permission Denial: forceStopPackage() from pid=10286, uid=2000 requires android.permission.FORCE_STOP_PACKAGES

java.lang.SecurityException: Permission Denial: forceStopPackage() from pid=10286, uid=2000 requires android.permission.FORCE_STOP_PACKAGES

at
com.android.server.am.ActivityManagerService.forceStopPackage(ActivityManagerService.java:8748)

at com.android.server.am.ActivityManagerShellCommand.runForceStop(ActivityManagerShellCommand.java:967)

at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:197)

at android.os.ShellCommand.exec(ShellCommand.java:103)

at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:20320)

at android.os.Binder.shellCommand(Binder.java:642)

at android.os.Binder.onTransact(Binder.java:540)

at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3442)

at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4181)

at android.os.Binder.execTransact(Binder.java:739)

Error: ADB exited with exit code 1 Performing Streamed Install

adb: failed to install /Users/wilfordmorrison/testnew/build/app/outputs/apk/app.apk:

Security exception: Permission Denial: runInstallCreate from pm command asks to run as user -1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL

java.lang.SecurityException: Permission Denial: runInstallCreate from pm command asks to run as user -1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL

at com.android.server.am.UserController.handleIncomingUser(UserController.java:1827)

at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:25069)

at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:4848)

at com.android.server.pm.PackageManagerShellCommand.translateUserId(PackageManagerShellCommand.java:2402)

at com.android.server.pm.PackageManagerShellCommand.doCreateSession(PackageManagerShellCommand.java:2408)

at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:907)

at com.android.server.pm.PackageManagerShellCommand.onCommand(Pa

Error launching application on SM J701M.

Exited (sigterm)

Regards,

Will

shb
  • 5,957
  • 2
  • 15
  • 32
WXM1967
  • 137
  • 1
  • 7
  • Edit: Did you add both permissions in AndroidManifest.xml? android.permission.FORCE_STOP_PACKAGES and android.permission.INTERACT_ACROSS_USERS_FULL – fadhli-sulaimi Jul 16 '19 at 07:26
  • I noted that in the submission. Adding these permissions in the android manifest file did not fix it. – WXM1967 Jul 16 '19 at 14:14
  • 1
    Upon testing and checking, the error above is not connected to the flutter version upgrade. The issue is the device. Samsung send out an update to my phone around the same time when I upgraded the flutter version. I have another device and the app works fine on it. Currently trying to find out what is causing the adb to fail. Will update once I fix it. – WXM1967 Jul 17 '19 at 03:59
  • I see. Thanks for the update. U can try on multiple android simulators to confirm if its working fine. But yea it sux that now u cant use your samsung device to test. – fadhli-sulaimi Jul 17 '19 at 04:04
  • dont think its because flutter version upgrade, i'm still using 1.5.4 hotfix 2 and got the exactly same error when i run it on my samsung android device that just upgraded to a new version – aswin darma Jul 18 '19 at 03:53

1 Answers1

1

try this.

  1. First turn off the developers option
  2. Restart your device
  3. Turn on again your developers option and turn on Usb Debugging

found it from here.

aswin darma
  • 398
  • 2
  • 3
  • 14