I was facing an error when I am trying to set device owner. I already removed all my accounts that tied to my phone but ADB still detect I have some accounts in the device. FYI. I am using the second method which uses ADB and PC to set device owner. Please help.
PS C:\Users\user\Downloads\platform-tools_r31.0.2-windows\platform-tools> ./adb shell dpm set-device-owner com.rrivenllc.shieldx/.receivers.DeviceAdmin
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
at android.os.Parcel.createException(Parcel.java:2096)
at android.os.Parcel.readException(Parcel.java:2056)
at android.os.Parcel.readException(Parcel.java:2004)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:9419)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:203)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:115)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:56)
at com.android.commands.dpm.Dpm.main(Dpm.java:41)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:342)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanSetDeviceOwnerLocked(DevicePolicyManagerService.java:9754)
at com.android.server.devicepolicy.DevicePolicyManagerService.setDeviceOwner(DevicePolicyManagerService.java:8764)
at android.app.admin.IDevicePolicyManager$Stub.onTransact(IDevicePolicyManager.java:4071)
at android.os.Binder.execTransactInternal(Binder.java:1056)
at android.os.Binder.execTransact(Binder.java:1029)
Device Owner Error
Moderators: Junior Moderator, Jr. Admin
- beowulf381
- Administrator
- Posts: 579
- Joined: Mon Dec 12, 2016 10:57 am
You can execute the command: 'adb shell pm list users' to see which users you have left.
Secure folder counts as user account too. So you may try to remove secure folder first. You can do this in the settings of secure folder (select the 3 dots in the upper right, select settings, select more settings, at the bottom you'll find uninstall).
Sometimes it helps to restart the device after removing all accounts.
Secure folder counts as user account too. So you may try to remove secure folder first. You can do this in the settings of secure folder (select the 3 dots in the upper right, select settings, select more settings, at the bottom you'll find uninstall).
Sometimes it helps to restart the device after removing all accounts.
- triplec87
- Alliance Member
- Posts: 4
- Joined: Fri Feb 26, 2021 9:08 am
After using your command I only saw my name in the userinfo. I never set any secure folder in my phone so this is not the concern. After I restarted my phone, now I get this.
PS C:\Users\user\Downloads\platform-tools_r31.0.2-windows\platform-tools> ./adb shell dpm set-device-owner com.rrivenllc.shieldx/.receivers.DeviceAdmin
usage: dpm [subcommand] [options]
usage: dpm set-active-admin [ --user <USER_ID> | current ] <COMPONENT>
usage: dpm set-device-owner [ --user <USER_ID> | current *EXPERIMENTAL* ] [ --name <NAME> ] <COMPONENT>
usage: dpm set-profile-owner [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
usage: dpm remove-active-admin [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
dpm set-active-admin: Sets the given component as active admin for an existing user.
dpm set-device-owner: Sets the given component as active admin, and its package as device owner.
dpm set-profile-owner: Sets the given component as active admin and profile owner for an existing user.
dpm remove-active-admin: Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device and profile owners.
dpm clear-freeze-period-record: clears framework-maintained record of past freeze periods that the device went through. For use during feature development to prevent triggering restriction on setting freeze periods.
dpm force-network-logs: makes all network logs available to the DPC and triggers DeviceAdminReceiver.onNetworkLogsAvailable() if needed.
dpm force-security-logs: makes all security logs available to the DPC and triggers DeviceAdminReceiver.onSecurityLogsAvailable() if needed.
usage: dpm grant-profile-owner-device-ids-access: [ --user <USER_ID> | current ] <COMPONENT>
Error: Trying to set an admin which is being removed
PS C:\Users\user\Downloads\platform-tools_r31.0.2-windows\platform-tools> ./adb shell dpm set-device-owner com.rrivenllc.shieldx/.receivers.DeviceAdmin
usage: dpm [subcommand] [options]
usage: dpm set-active-admin [ --user <USER_ID> | current ] <COMPONENT>
usage: dpm set-device-owner [ --user <USER_ID> | current *EXPERIMENTAL* ] [ --name <NAME> ] <COMPONENT>
usage: dpm set-profile-owner [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
usage: dpm remove-active-admin [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
dpm set-active-admin: Sets the given component as active admin for an existing user.
dpm set-device-owner: Sets the given component as active admin, and its package as device owner.
dpm set-profile-owner: Sets the given component as active admin and profile owner for an existing user.
dpm remove-active-admin: Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device and profile owners.
dpm clear-freeze-period-record: clears framework-maintained record of past freeze periods that the device went through. For use during feature development to prevent triggering restriction on setting freeze periods.
dpm force-network-logs: makes all network logs available to the DPC and triggers DeviceAdminReceiver.onNetworkLogsAvailable() if needed.
dpm force-security-logs: makes all security logs available to the DPC and triggers DeviceAdminReceiver.onSecurityLogsAvailable() if needed.
usage: dpm grant-profile-owner-device-ids-access: [ --user <USER_ID> | current ] <COMPONENT>
Error: Trying to set an admin which is being removed
- beowulf381
- Administrator
- Posts: 579
- Joined: Mon Dec 12, 2016 10:57 am
Looks like there's an issue with the device policy.
Some questions:
Is the shield app still set as device admin?
Is or was the device managed by some third-party MDM (mobile device management)?
Would suggest you open a support-ticket in our discord-server.
https://discord.com/invite/YzYfgWP
Accept invite, then navigate to #support-ticket
Some questions:
Is the shield app still set as device admin?
Is or was the device managed by some third-party MDM (mobile device management)?
Would suggest you open a support-ticket in our discord-server.
https://discord.com/invite/YzYfgWP
Accept invite, then navigate to #support-ticket
- triplec87
- Alliance Member
- Posts: 4
- Joined: Fri Feb 26, 2021 9:08 am
When I first install the shield app I just follow the wizard to setup. I remember I set Device Admin and Knox inside the wizard. When I go to my phone settings -> Apps -> Special access -> Device admin apps, I saw Alliance Shield X is not turned on and Enable Device Admin is turned on.
I am not sure my device is managed by third party MDM apps. How can I check it?
I am not sure my device is managed by third party MDM apps. How can I check it?
- beowulf381
- Administrator
- Posts: 579
- Joined: Mon Dec 12, 2016 10:57 am
The settings you mentined above are correct. You can check if there are some other apps (other than Alliance Shield X and Enable Device Admin) listed in device admin apps. Is this would trhe case, which other app are listed there, and are they enabled?
- beowulf381
- Administrator
- Posts: 579
- Joined: Mon Dec 12, 2016 10:57 am
se receber a mensagem Too may devices, você pode remover os não utilizados aqui. Faça login e exclua os antigos.
https://shieldx.alliancex.org/account
https://shieldx.alliancex.org/account
