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.
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 :
P.S: next time please give more information and search the community: