"can't setup device- couldn't install the admin app" Android Management API


Last year we’ve setup AMAPI with couple of devices. Recently we’ve got a new device, but when I tried to set it up I got "can't setup device- couldn't install the admin app".

I’ve tried to:

  • reset/restart the device many times
  • generate a different policy
  • wait a few days and retry ( I’ve read somewhere that it can be due to Google )
  • setup an old device again ( this also failed )

I used the same code that worked once with the same service account.

Here’s the response of the enrollmentToken:

    "name": "enterprises/LC01aymplz/enrollmentTokens/izqaqdWxscS7wDwMYIWeTm7k81rFtpVjv9nxgUhtw7k",
    "duration": "7776000s",
    "expirationTimestamp": "2022-06-26T05:40:04.054Z",
    "policyName": "enterprises/LC01aymplz/policies/dh_ewelink",
    "qrCode": "{\"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME\":\"com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver\",\"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM\":\"xx\",\"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION\":\"https://play.google.com/managed/downloadManagingApp?identifier=setup\",\"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE\":{\"com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN\":\"xx\"}}"


The main issue was that I’ve setup the AMAPI more than a year ago, and the API has changed.

I’ve walked through the documentation again and found out that:

  • contactInfo on enterprise is required now, but then it was optional ( just patch the enterprise )
  • allowPersonalUsage is also required when creating an enrollmentToken

Making these changes fixed the issue.

Answered By – Bojke

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published