Reason for these Run time error

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.

Read more here:
https://source.android.com/devices/tech/config/device-identifiers
and here

2 Likes