title: Making my app a device owner doesn't work
body: <p>I need to update my application silently (as described <a href="https://www.sisik.eu/blog/android/dev-admin/update-app" rel="nofollow noreferrer">here</a>).</p>
  
  <p>So I need to make my app a device owner in phone SAMSUNG S6. I use dpm command through adb shell command, so I provision my device (remove all account from Settings->Accounts), enable developer mode, enable debugging, install my app as usual (install it with Android Studio for example) and then run command:</p>
  
  <pre><code>adb shell dpm set-device-owner &lt;PACKAGE-NAME&gt;/.DeviceAdminComponent
  </code></pre>
  
  <p>But I get a next error:</p>
  
  <pre><code>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:1701)
          at android.os.Parcel.readException(Parcel.java:1646)
          at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:6123)
          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:301)
  </code></pre>
  
  <p>It's a very strange. If I run this command:</p>
  
  <pre><code>adb shell dpm set-profile-owner &lt;PACKAGE-NAME&gt;/.DeviceAdminComponent
  </code></pre>
  
  <p>It works me fine.</p>
  
  <p>Can somebody help me in this issue? Maybe it happens due to KNOX of SAMSUNG? (I see through Device Administrators - My Knox Policy Admin, that I can't disable). </p>