码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-04-29 18:16:15      阅读:1324      评论:0      收藏:0      [点我收藏+]

标签:android   com   http   blog   style   div   img   java   size   tar   ext   

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" />  
再次运行可以了。
 mamicode.com,码迷
错误日志:
 
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.

标签:android   com   http   blog   style   div   img   java   size   tar   ext   

原文地址:http://www.cnblogs.com/dava/p/3698126.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!