Android 开发之错误整理java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor current process has android.permission.READ_PHONE_STATE.

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

今天写了一款发短信的软件,拿了个酷派5879,试了下,结果不能用,把try{}catch{}去掉了,报这个错误,

android.permission.READ_PHONE_STATE.没有READ_PHONE_STATE权限,于是在manifest.xml中添加权限。

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

再次运行可以了。

错误日志:

04-28
22:23:07.862: E/Trace(26834): error opening trace file: No such file or
directory (2)

04-28
22:23:18.152: E/AndroidRuntime(26834): FATAL EXCEPTION: main

04-28
22:23:18.152: E/AndroidRuntime(26834):
java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor
current process has android.permission.READ_PHONE_STATE.

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.os.Parcel.readException(Parcel.java:1425)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.os.Parcel.readException(Parcel.java:1379)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.android.internal.telephony.ISms$Stub$Proxy.sendText(ISms.java:736)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.telephony.SmsManager.sendTextMessage(SmsManager.java:88)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.dava.helpmywife.sendMessage.sendMessage(sendMessage.java:36)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.dava.helpmywife.inits$3.onClick(inits.java:82)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:171)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.os.Handler.dispatchMessage(Handler.java:99)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.os.Looper.loop(Looper.java:137)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
android.app.ActivityThread.main(ActivityThread.java:4802)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
java.lang.reflect.Method.invokeNative(Native Method)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
java.lang.reflect.Method.invoke(Method.java:511)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)

04-28
22:23:18.152: E/AndroidRuntime(26834): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)

04-28
22:23:18.152: E/AndroidRuntime(26834): at dalvik.system.NativeStart.main(Native
Method) 

Android 开发之错误整理java.lang.SecurityException: Requires
READ_PHONE_STATE: Neither user 10088 nor current process has
android.permission.READ_PHONE_STATE.,码迷,mamicode.com

Android 开发之错误整理java.lang.SecurityException: Requires
READ_PHONE_STATE: Neither user 10088 nor current process has
android.permission.READ_PHONE_STATE.

时间: 2024-12-04 13:25:05

Android 开发之错误整理java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor current process has android.permission.READ_PHONE_STATE.的相关文章

今天扫描二维码时出现一个奇葩错误:java.lang.SecurityException: Unab

后经多方查找,终于在stackoverflow中找到答案:http://stackoverflow.com/questions/18096607/using-crop-intent-getting-java-lang-securityexception-unable-to-find-app-for-ca 原文如下: This log means that your app is having trouble handling a communication intent. Sometimes p

java.lang.SecurityException: Permission Denial: opening provider

在测试调用外部提供的ContentProvider时候报一下错误: java.lang.SecurityException: Permission Denial: opening provider com.example.onehw.BookProvider from ProcessRecord{b2f1b230 8449:com.example.adtest/u0a53} (pid=8449, uid=10053) that is not exported from uid 10052 at

Android 4.4: java.lang.SecurityException: Package com.android.settings does not belong to 1001

问题描述: 在Android4.4.2上面定制的东西,今天code base改为Android4.4.4. 代码merge到新的Android 4.4.4 code base后,clean build后会报出下面错误: 1 W/dalvikvm( 3125): threadid=1: thread exiting with uncaught exception (group=0x415e8d58) 2 W/AppOps ( 1053): Bad call: specified package c

AIDL 发生异常的原因 Android java.lang.SecurityException: Binder invocation to an incorrect interface

我建立了两个project.一个是activity 的 ,一个是service 的. 在进行两个project通信时,应该有以下几点注意: 1.在activity project中引入service project中aidl文件.注意引入后的aidl文件包名应该和service中aidl文件包名保持一致. 2.service project中manifest文件中,service 注册时要声明 android:process=":remote" action应该是aidl中接口的包名.

Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://...

在as中创建cordova中添加从相册选取照片的插件 $cordovaImagePicker 就是以上这货,调用后直接程序就崩溃了,并报错 Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://... 添加权限 <uses-permission android:name="android.permis

使用sqljdbc连接mssql数据库,maven生成jar运行后报&quot;Exception in thread &quot;main&quot; java.lang.SecurityException&quot;错误

错误信息如下: Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes 网上查到,说是需要重新打一下sqljdbc    http://blog.chinaunix.net/uid-26706281-id-3210704.html 把该博客的内容copy下来: 插件打成的jar包运行出现这个异常,异常处理办法 1.

Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.HEADSET_PLUG

crash information:Caused by: java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.HEADSET_PLUG from    at android.os.Parcel.readException(Parcel.java:1465)     at android.os.Parcel.readException(Parcel.j

java.lang.SecurityException: Can&#39;t make field constructor accessible

原本使用GsonConvertor,在Android版本5.1.1上没有任何问题,结果切换到版本6.0.1上,出现以下所示问题: java.lang.IllegalArgumentException: Unable to create converter for java.util.List<model> ,StackOverFlow有个帖子谈这个问题http://stackoverflow.com/questions/34315499/unable-to-create-converter-f

常见错误之java.lang.IllegalStateException: The application’s PagerAdapter changed the adapter’s cont。。。

如果在logcat日志中出现以下错误: java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 0, found: 4 Pager id: com.activity_test.logo:id/viewpag