title: adb dpm set-device-owner not working when installed outside of android studio
body: <p>I am having an issue with trying to set the device owner on my android device. If I install the app onto the physical device from within android studio by hitting the play button, I am able to add and remove device owner with <code>adb shell dpm set-device-owner package/.receiver</code> without any issues. I can do this from within android studio or via cmd.</p>
  <p>When I install the app from using the apk and manually installed or using adb outside of android studio, I can no longer set the device owner. I always get the error <code>Not allowed to set the device owner because there are already some accounts on the device</code></p>
  <p>This is what makes no sense, as there are no accounts on the device. I can go back into android studio, install the app over the top of it and run the adb command again and it works just fine without doing anything else.</p>
  <p>I am lost here because there error seems incorrect, but I have no idea why installing from the apk outside of android studio is not working.</p>
  <p>Edit: Some notes</p>
  <ul>
  <li>I am not testing with an emulator. When I say installing from android studio, I mean installing directly to the phone, not an emulator</li>
  <li>I have the manifest pointing to the xml with  properly
  defined</li>
  <li>The app works fine when installing from android studio and
  setting device owner, I am getting all the expected permissions</li>
  <li>When I install from the output apk, I am no longer able to set device
  owner (previous was cleared, even tried on a fresh recovery of the
  phone. Accounts settings is empty with no accounts listed)</li>
  </ul>