Security exception: uid does not have android.permission.MANAGE_APP_OPS_MODES.

If for some reason you got the following exception, “java.lang.SecurityException: uid 2000 does not have android.permission.MANAGE_APP_OPS_MODES”

java.lang.SecurityException: uid 2000 does not have android.permission.MANAGE_APP_OPS_MODES.
at android.app.ContextImpl.enforce(ContextImpl.java:1953)
at android.app.ContextImpl.enforcePermission(ContextImpl.java:1962)
at com.android.server.appop.AppOpsService.enforceManageAppOpsModes(AppOpsService.java:1307)
at com.android.server.appop.AppOpsService.onShellCommand(AppOpsService.java:3723)
at com.android.server.appop.AppOpsService$Shell.onCommand(AppOpsService.java:3350)
at android.os.ShellCommand.exec(ShellCommand.java:104)
at com.android.server.appop.AppOpsService.onShellCommand(AppOpsService.java:3520)
at android.os.Binder.shellCommand(Binder.java:881)
at android.os.Binder.onTransact(Binder.java:765)
at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:822)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)

Then the solution to this problem is as below,

  • Open Settings App
  • Enable Developer Settings
  • Click on Developer Options
  • Enable “disable permission monitoring”

Leave a Comment