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:
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",
"value": "QFXVLZHIWZMVBPLWFFRT",
"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.