It looks like you have trying to get device id from android 10. getDeviceId() is deprecated is android 10.
getDeviceId()