Welcome @sahin_caglar ,
You are probably getting these errors on devices with Android 10 or heigher.. See here why you can no longer access device identifiers starting from Android 10 :
Hello @R_J_ARUN_RAJ and welcome to the community!
Most probably this error comes when you try to get Device ID on Android 10 (Q) device because Android 10 restricted access to the following:
getDeviceId
getImei
getMeid
getSimSerialNumber
getSubscriberId
getSerial
All these blocks won’t work on Android 10 devices because the application needs this permission:
android.permission.READ_PRIVILEGED_PHONE_STATE
Which is granted to only apps signed with the platform key and privileged system apps…
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 re…
P.S: next time please give more information and search the community:
Asking questions
To improve the chance of getting help on the forum please follow these recommendations when posting a question:
Do your homework first
Search for similar questions/answers on the forum. Try forum search and also Google your problem.
Try to solve the problem yourself, and describe what you have tried. It is much more rewarding to help someone who has tried himself first.
Post in the right categorie, post only once and do not steal topics
Make sure that you post your question …
3 Likes