Error getting IMEI or Device ID

Nope i think you are utesting on android 10 ( i didn’t mean the min api ) :

Android Q (Android 10 ) has restricted to access for both IMEI and serial no. It is available only for platform and apps with special carrier permission. Also the permission READ_PRIVILEGED_PHONE_STATE is not available for non platform apps.
If you try to access it throws below exception

java.lang.SecurityException: getImeiForSlot: The user 10180 does not meet the requirements to access device identifiers.

Please refer documentation: Privacy changes in Android 10  |  Android Developers
Also refer Issue
From : https://stackoverflow.com/questions/55173823/i-am-getting-imei-null-in-android-q


Suggestion : don’t collect imei from users.

3 Likes