Intermittent QR Code Provisioning Failures with Identical Source Code
I am experiencing inconsistent behavior with QR code provisioning for Android Enterprise and am seeking guidance from the community.
The Issue:
QR code provisioning works intermittently, but the failure pattern is inconsistent. A provisioning QR code generated from a specific APK build will work reliably. However, subsequent builds of the exact same source code from the same Android Studio project will sometimes fail. The device displays a generic "Contact your IT admin" error.
What I've Verified:
- The APK is properly signed and the checksum in the QR code is correct.
- The server delivers the APK with the correct application/vnd.android.package-archive MIME type.
- The DeviceAdminReceiver is correctly declared in the manifest and the associated XML resource exists.
- The package name and component name in the QR code are 100% accurate.
- Comparing a "working" APK and a "failing" APK in APK Analyzer shows no differences in the core components (package name, receivers, resources).
Question:
Has anyone else encountered this? Are there known issues with Android's provisioning service being sensitive to certain aspects of the APK build output that are not related to the core functionality or signature?
Any insight into how to achieve consistent, reproducible builds for provisioning would be greatly appreciated.