相关文章推荐
跑龙套的小笼包  ·  rk3568 ...·  5 天前    · 
有爱心的香槟  ·  android studio ...·  4 天前    · 
温文尔雅的火龙果  ·  import cv2 # ...·  2 月前    · 
强健的登山鞋  ·  linux上hostname: ...·  1 年前    · 
怕考试的鼠标  ·  机器学习第18篇 - ...·  1 年前    · 

java.lang.SecurityException: Neither user *** nor current process has android.permission.READ_PHONE

安卓开发过程中,我们会经常遇到一些另类的机型,需要单独适配一下。比如,我遇到了一个问题:

java.lang.SecurityException: Neither user 10253 nor current process has android.permission.READ_PHONE_STATE.

这个报错异常出现在荣耀6P手机上,当时我还纳闷,为啥别的手机都没问题,就它崩溃呢。后来一看日志,发现又是一个需要适配的机型。解决方法很简单,当然也有别的解决方法,这里就不讨论了。通过分析报错的内容,可以知道是权限的问题,因此,我们需要向系统申请相应的权限。修改AndroidManifest.xml,添加语句如下:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

希望有朝一日,我们的安卓厂商们可以像苹果一样有一个统一的标准。

【Android】java.lang.SecurityException: getDeviceId: Neither user 10065 nor current process has android.permission.READ_PHONE_STATE

RT, 异常信息如下:java.lang.SecurityException: getDeviceId: Neither user 10065 nor current process has android.permission.READ_PHONE_STATE.PS:Android Studio 版本:2.3.3模拟器环境:Genymotion, Android 7.1.1, API 2

java.lang.SecurityException: getSubscriberId: Neither user 10192 nor current process has android.per

问题描述:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.daxuetong.app/c

Caused by: java.lang.SecurityException: setDefaultDataSubId: Neither user 10214 nor current proce...

Caused by: java.lang.SecurityException: setDefaultDataSubId: Neither user 10214 nor current process has android.permission.MODIFY_PHONE_STATE.移动到​​/system/ priv-app​​​ 更多资料 如何查询是哪个app呢。​​​cat /data/sy