3

I know question has been asked but i can't get device ownership.

I'm with a samsung xcover 4 with android 7.0.

I launch this command :

C:\Users\xxx\AppData\Local\Android\Sdk\platform-tools>adb shell dpm set-device-owner org.wso2.iot.system.service/.ServiceDeviceAdminReceiver

I get this error :

java.lang.IllegalStateException: Not allowed to set the device owner because the
re are already some accounts on the device
        at android.os.Parcel.readException(Parcel.java:1701)
        at android.os.Parcel.readException(Parcel.java:1646)
        at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDev
icePolicyManager.java:6067)
        at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:148)
        at com.android.commands.dpm.Dpm.onRun(Dpm.java:96)
        at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
        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:316)

factory reset done. I also disable and uninstall all applications but still no luck. Any solution? Thanks.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Alex Lum
  • 175
  • 2
  • 12
  • I get the same issue with an XCover4, I'm guessing that the samsung setup creates some kind of account on the phone during the initial setup that is not visible from the accounts. Did you find a solution? – Gary Wright Mar 14 '18 at 13:31
  • Had similar issue. Finally, I found a workaround. You can use QR code to provision the device. developers.google.com/android/work/prov-devices#qr_code_method – Abhas Tandon May 23 '18 at 13:35

1 Answers1

7

As the error states

because there are already some accounts on the device

Go to Settings -> Accounts and remove all accounts (like Gmail, Facebook, ...). When there are no more accounts, try again.

vixez
  • 846
  • 9
  • 25