2013-04-17 37 views
2

我有一個項目A作爲庫jar文件,它包含一個ContentProvider。然後,我需要用它在項目B.作爲在清單中聲明:SecurityException:權限拒絕。從xxx開放供應商xxx不從uid導出10027

 <provider 
     android:authorities="com.gezbox.android.onepiece" 
     android:exported="true" 
     android:name="com.gezbox.android.api.provider.GezboxProvider"/> 

但是問題來了,那麼:

04-17 17:55:50.695: WARN/dalvikvm(5527): threadid=13: thread exiting with uncaught exception (group=0x40def300) 
04-17 17:55:50.695: WARN/ActivityManager(258): Permission denied: checkComponentPermission() owningUid=10027 
04-17 17:55:50.695: WARN/ActivityManager(258): Permission denied: checkComponentPermission() owningUid=10027 
04-17 17:55:50.695: WARN/ActivityManager(258): Permission Denial: opening provider com.gezbox.android.api.provider.GezboxProvider from ProcessRecord{415d5e08 5527:com.gezbox.android.onepiece/u0a31} (pid=5527, uid=10031) that is not exported from uid 10027 
04-17 17:55:50.711: ERROR/AndroidRuntime(5527): FATAL EXCEPTION: IntentService[GezboxService] 
     java.lang.SecurityException: Permission Denial: opening provider com.gezbox.android.api.provider.GezboxProvider from ProcessRecord{415d5e08 5527:com.gezbox.android.onepiece/u0a31} (pid=5527, uid=10031) that is not exported from uid 10027 

     at android.os.Parcel.readException(Parcel.java:1425) 
     at android.os.Parcel.readException(Parcel.java:1379) 
     at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2354) 
     at android.app.ActivityThread.acquireProvider(ActivityThread.java:4219) 
     at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:1688) 
     at android.content.ContentResolver.acquireProvider(ContentResolver.java:1083) 
     at android.content.ContentResolver.acquireContentProviderClient(ContentResolver.java:1146) 
     at android.content.ContentResolver.applyBatch(ContentResolver.java:896) 
     at com.gezbox.android.api.processor.PostOrderProcessor.updateContentProvider(PostOrderProcessor.java:57) 
     at com.gezbox.android.api.processor.PostOrderProcessor.post_order(PostOrderProcessor.java:33) 
     at com.gezbox.android.api.GezboxService.onHandleIntent(GezboxService.java:196) 
     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) 
     at android.os.Handler.dispatchMessage(Handler.java:99) 
     at android.os.Looper.loop(Looper.java:137) 
     at android.os.HandlerThread.run(HandlerThread.java:60) 

回答

0

問題解決了。我改變了供應商的URI在項目B.提供商

是的,我是如此傾倒......

圖書館項目由另一個人寫道,每次我之前編譯項目,我需要手動更改URI以便它適合正確的道路。

+1

嗨!你能解釋一下你用xml做了什麼嗎?我也面臨這個問題。 –

+0

是的,爲什麼URI每次都會改變?這聽起來不對。 –

相關問題