I am developing an Android application in Android 6 and my application in a service needs to get device ID(getDeviceId
). I have set android.permission.READ_PHONE_STATE
in the manifest file, but at run time I got this error:
neither user 10632 nor current process has android.permission.READ_PHONE_STATE. java.lang.SecurityException:getDeviceId need android.permission.Read_Phone_state
I install my apk file using adb install myapk.apk
and I suppose that all of application's required permissions are granted at install time.