我正在关注此
tutorial以将应用程序设置为设备所有者.在该教程中,有一节“使用adb设置设备所有者”.这里的教程说明在安装Kiosk模式演示应用程序后,运行以下命令:
adb shell dpm set-device-owner sdg.example.kiosk_mode/.AdminReceiver
这给了我错误:
adb server is out of date. killing...
* daemon started successfully *
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
at android.os.Parcel.readException(Parcel.java:1629)
at android.os.Parcel.readException(Parcel.java:1574)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:5146)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)
我跟着这个SO link,迭戈Plascencia Lara的答案帮助我摆脱了
adb server is out of date. killing...
* daemon started successfully *
但运行adb shell dpm set-device-owner sdg.example.kiosk_mode / .AdminReceiver命令后仍然出现以下错误:
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
at android.os.Parcel.readException(Parcel.java:1629)
at android.os.Parcel.readException(Parcel.java:1574)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:5146)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)
为什么会发生此错误,如何删除?我之前曾尝试将不同的应用程序设置为设备所有者,但我认为我没有设法完全取消它们,并且在完成使应用程序在设备上运行的整个过程时总会出现一些错误.