Getting 'No active admin' SecurityException in Android 10 - how to resolve?

17.5k views Asked by At

I am encountering an error in the pre-launch report on the Google Play Console during testing. The error message is as follows:

java.lang.SecurityException: No active admin ComponentInfo{com.google.android.apps.mtaas.deviceadmin/com.google.android.apps.mtaas.deviceadmin.DeviceAdminReceiver}

This error occurs specifically in Android 10 (SDK 29). The full error summary is as follows:


Exception Process: com.google.android.apps.mtaas.deviceadmin, PID: 4380
java.lang.SecurityException: No active admin ComponentInfo{com.google.android.apps.mtaas.deviceadmin/com.google.android.apps.mtaas.deviceadmin.DeviceAdminReceiver}
  at android.os.Parcel.createException (Parcel.java:2088)
  at android.os.Parcel.readException (Parcel.java:2056)
  at android.os.Parcel.readException (Parcel.java:2004)
  at android.app.admin.IDevicePolicyManager$Stub$Proxy.setNetworkLoggingEnabled (IDevicePolicyManager.java:15305)
  at android.app.admin.DevicePolicyManager.setNetworkLoggingEnabled (DevicePolicyManager.java:11627)
  at com.google.android.apps.mtaas.deviceadmin.EnableNetworkLogging.onStart (EnableNetworkLogging.kt:27)
  at android.app.Instrumentation$InstrumentationThread.run (Instrumentation.java:2209)
Caused by android.os.RemoteException: Remote stack trace:
  at com.android.server.devicepolicy.DevicePolicyManagerService.getActiveAdminWithPolicyForUidLocked (DevicePolicyManagerService.java:3259)
  at com.android.server.devicepolicy.DevicePolicyManagerService.getActiveAdminOrCheckPermissionForCallerLocked (DevicePolicyManagerService.java:3155)
  at com.android.server.devicepolicy.DevicePolicyManagerService.getActiveAdminForCallerLocked (DevicePolicyManagerService.java:3136)
  at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanManageScopeOrCheckPermission (DevicePolicyManagerService.java:7218)
  at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanManageScope (DevicePolicyManagerService.java:7204)

I need assistance in resolving this specific error. Any help or guidance would be greatly appreciated.

5

There are 5 answers

4
BamsBamx On

Just got the same report a while ago. Looks like there is a problem related to the devices/emulator that Google uses for generating the report.

At least in my case, it is not related to the tested app, since it doesn't have a single dependency on Google libraries

EDIT: You can find a similar report in the Google Issue Tracker: https://issuetracker.google.com/issues/160907013#comment144

1
Gabriel Bateca On

I just got the same error while trying to publish my Flutter app to the Play Store. I removed some packages. Curious enough, this error is with a Samsung device. I'll leave you the stack trace in case it may be useful.

It still appears as "in review" so I'm not sure if I will be able to ignore the error and promote it to production.

Stack trace

java.lang.SecurityException: No active admin ComponentInfo{com.google.android.apps.mtaas.deviceadmin/com.google.android.apps.mtaas.deviceadmin.DeviceAdminReceiver}


Exception Process: com.google.android.apps.mtaas.deviceadmin, PID: 6114
java.lang.SecurityException: No active admin ComponentInfo{com.google.android.apps.mtaas.deviceadmin/com.google.android.apps.mtaas.deviceadmin.DeviceAdminReceiver}
  at android.os.Parcel.createException (Parcel.java:2088)
  at android.os.Parcel.readException (Parcel.java:2056)
  at android.os.Parcel.readException (Parcel.java:2004)
  at android.app.admin.IDevicePolicyManager$Stub$Proxy.setNetworkLoggingEnabled (IDevicePolicyManager.java:15305)
  at android.app.admin.DevicePolicyManager.setNetworkLoggingEnabled (DevicePolicyManager.java:11627)
  at com.google.android.apps.mtaas.deviceadmin.EnableNetworkLogging.onStart (EnableNetworkLogging.kt:27)
  at android.app.Instrumentation$InstrumentationThread.run (Instrumentation.java:2209)

Device that prompts the error

1
OK_1 On

I just contacted Google Play support about that issue, and this is what they responded:

Support: "Please note that pre-launch reports do not block releases to any tracks."

Support: "It only helps to identify issues proactively before your app reaches testers."

Support: "This means that it only informs you of any possible issues in your testing tracks' new releases, but it does not prevent you from continuing to publish those releases."

Support: "Furthermore, pre-launch reports only test releases you've uploaded to the open, closed, and internal testing tracks; it does not test for releases uploaded to the Production track."

Support: "If you are confident that your release does not have any errors, then you can proceed to ignore the error in the pre-launch report and publish your release."

Support: "For more information about the pre-launch reports, please refer to our Help Center. https://support.google.com/googleplay/android-developer/answer/9842757 "

Me: "So the report does not have an affect on final review before publishing to production, correct?"

Support: "Yes, that is correct."

0
Paras Rawat On

Solution: Do nothing

Explanation: Pre-launch reports do not block releases to any tracks

0
Walulya francis On

This may sound odd, but the real problem causing this is if you have webservice in your application like API calls and you did not do error handling properly like adding you code between

 try{ //
 your webservice request
 }catch(e){
// error handling
} 

and if you have used old libraries or libraries without proper error handling. you will face the same problem. After doing all error handling properly, change the app version name and code in pubspec.yaml as follows version: 1.0.1+2 then run commands flutter clean and flutter build appbundle --release to create a new app bundle