Neither User 10102 Nor Current Process Has Android.Permission.Read_Phone_State

neither user 10632 nor current process has android.permission.READ_PHONE_STATE error in Android 6

You also need to request permission at run time.

int permissionCheck = ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.READ_PHONE_STATE);

If the app has the permission, the method returns PackageManager.PERMISSION_GRANTED, and the app can proceed with the operation. If the app does not have the permission, the method returns PERMISSION_DENIED, and the app has to explicitly ask the user for permission.

If you dont get it , you should request it

ActivityCompat.requestPermissions(thisActivity,
new String[]{Manifest.permission.READ_PHONE_STATE},
MY_PERMISSIONS_REQUEST_READ_PHONE_STATE);

Neither user 10085 nor current process has android.permission.READ_PHONE_STATE

Solved using this::

 deviceId = Settings.Secure.getString(context.getContentResolver(),
InstanceID.getInstance(context).getId());


Related Topics



Leave a reply



Submit