一个 Android 数据库的错误,望大虾们指点啊

天高空 发布于 2011/08/02 14:45
阅读 7K+
收藏 0

ERROR/AndroidRuntime(222): ERROR: thread attach failed

这是什么错误

08-02 06:46:51.471: ERROR/DatabaseUtils(108): Writing exception to parcel 08-02 06:46:51.471: ERROR/DatabaseUtils(108): java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.CallLogProvider uri content://call_log/calls from pid=258, uid=10028 requires android.permission.READ_CONTACTS 08-02 06:46:51.471: ERROR/DatabaseUtils(108): at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:240) 08-02 06:46:51.471: ERROR/DatabaseUtils(108): at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:116) 08-02 06:46:51.471: ERROR/DatabaseUtils(108): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:98) 08-02 06:46:51.471: ERROR/DatabaseUtils(108): at android.os.Binder.execTransact(Binder.java:287) 08-02 06:46:51.471: ERROR/DatabaseUtils(108): at dalvik.system.NativeStart.run(Native Method) 08-02 06:46:51.530: DEBUG/AndroidRuntime(258): Shutting down VM 08-02 06:46:51.592: WARN/dalvikvm(258): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 08-02 06:46:51.600: ERROR/AndroidRuntime(258): Uncaught handler: thread main exiting due to uncaught exception 08-02 06:46:51.740: ERROR/AndroidRuntime(258): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.acg/com.acg.CallLogActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.CallLogProvider uri content://call_log/calls from pid=258, uid=10028 requires android.permission.READ_CONTACTS 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.os.Handler.dispatchMessage(Handler.java:99) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.os.Looper.loop(Looper.java:123) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread.main(ActivityThread.java:4363) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at java.lang.reflect.Method.invokeNative(Native Method) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at java.lang.reflect.Method.invoke(Method.java:521) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at dalvik.system.NativeStart.main(Native Method) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.CallLogProvider uri content://call_log/calls from pid=258, uid=10028 requires android.permission.READ_CONTACTS 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.os.Parcel.readException(Parcel.java:1218) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.content.ContentProviderProxy.bulkQuery(ContentProviderNative.java:326) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.content.ContentProviderProxy.query(ContentProviderNative.java:345) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.content.ContentResolver.query(ContentResolver.java:202) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at com.acg.CallLogActivity.onCreate(CallLogActivity.java:16) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 08-02 06:46:51.740: ERROR/AndroidRuntime(258): ... 11 more

加载中
0
红薯
红薯

java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.CallLogProvider uri content://call_log/calls from pid=258, uid=10028 requires android.permission.READ_CONTACTS 08-02

你没有读写通讯录的权限,详细的权限可看这里

http://blog.sina.com.cn/s/blog_3f7f41d40100ciw7.html

0
wubotao
wubotao
Permission Denial——这貌似是权限问题。在 AndroidManifest.xml加上对应的权限:   <uses-permission android:name="android.permission.READ_CONTACTS" />和 <uses-permission android:name="android.permission.WRITE_CONTACTS" />
wubotao
wubotao
@天高空 : http://groups.google.com/group/android-developers/browse_thread/thread/addd2a507ea8b166 貌似是说原因是线程间存在冲突,但是是无害的。http://stackoverflow.com/questions/3421513/android-runtime-thread-attach-failed 可以把模拟器和Eclipse关掉再重启试试。
天高空
天高空
对,可是上面的那个关于stread的问题是怎么回事啊
天高空
天高空
对,可是上面的那个关于stread的问题是怎么回事啊
0
wubotao
wubotao
红薯竟然抢先一步了!
0
天高空
天高空
谢谢 各位谢谢
返回顶部
顶部