java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{71740b2 14910:org.xwalk.usecase_cordova_android_tests/u0a363} (pid=14910, uid=10363) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS

JIRA | jingqiaX | 7 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    Impacted Cases ============== usecase-cordova/CordovaContacts Reproduce Test Steps ==================== 1. Install usecase-cordova-android-tests.apk(Please find the link in comment) 2. Launch usecase-cordova-android-tests app and enter Cordova/CordovaContacts 3. Tap "Get phone's contacts" or "Add a new contact 'Dooney Evans'" Expected Outcome ================ After 3. Phone's contacts could show and no crash occur. Actual Outcome ============== After 3. Crash occur when try to get or add Contacts for cordova Test Case Source Code ===================== ||Type||URL|| |Souce code in github| https://github.com/crosswalk-project/crosswalk-test-suite/tree/master/usecase/usecase-cordova-android-tests/| |Souce code in github| https://github.com/crosswalk-project/demo-express/tree/master/samples-cordova/CordovaContacts/ | Test Builds =========== ||Version||Test Date ||Test Device||Android Version||Result|| |crosswalk 20.50.533.6|2016.07.15|Google Nexus 9|5.1.1|{color:green}Pass{color}| |crosswalk 20.50.533.6|2016.07.15|Google Nexus 9|6.0.0|{color:red}Fail{color}| |crosswalk 20.50.533.11|2016.07.15|Google Nexus 9|5.1.1|{color:green}Pass{color}| |crosswalk 20.50.533.11|2016.07.15|Google Nexus 9|6.0.0|{color:red}Fail{color}| |crosswalk 21.51.546.2|2016.07.15|Google Nexus 9|6.0.0|{color:red}Fail{color}| |crosswalk 21.51.542.0|2016.07.15|Google Nexus 9|6.0.0|{color:red}Fail{color}| |crosswalk 21.51.542.0|2016.07.15|Google Nexus 9|5.1.1|{color:green}Pass{color}| Issue Analysis ============== {code} 07-15 03:50:19.389 14910 16759 E AndroidRuntime: FATAL EXCEPTION: pool-1-thread-4 07-15 03:50:19.389 14910 16759 E AndroidRuntime: Process: org.xwalk.usecase_cordova_android_tests, PID: 14910 07-15 03:50:19.389 14910 16759 E AndroidRuntime: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{71740b2 14910:org.xwalk.usecase_cordova_android_tests/u0a363} (pid=14910, uid=10363) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1620) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1573) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.app.ActivityThread.acquireProvider(ActivityThread.java:4778) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.content.ContentResolver.query(ContentResolver.java:475) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at android.content.ContentResolver.query(ContentResolver.java:434) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:177) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at org.apache.cordova.contacts.ContactManager$1.run(ContactManager.java:93) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 07-15 03:50:19.389 14910 16759 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818) 07-15 03:50:19.391 584 1068 W ActivityManager: Force finishing activity org.xwalk.usecase_cordova_android_tests/.usecase_cordova_android_tests {code}

    JIRA | 7 months ago | jingqiaX
    java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{71740b2 14910:org.xwalk.usecase_cordova_android_tests/u0a363} (pid=14910, uid=10363) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
  2. 0
    samebug tip
    You need the permission android.permission.READ_EXTERNAL_STORAGE. Write <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> on the Android Manifest
  3. 0

    Fatal exception error

    Stack Overflow | 3 years ago | user2850116
    java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/audio/media from pid=1071, uid=10066 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/40763 from pid=18326, uid=10114 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()

    GitHub | 2 years ago | agwells
    java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/40763 from pid=18326, uid=10114 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
  6. 0

    Avoid SecurityException when accessing DownloadProvider

    Stack Overflow | 4 years ago | ademers
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.UploadActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/1145 from pid=16585, uid=10086 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()

  1. Adrien 30 times, last 2 weeks ago
  2. gamebusterz 5 times, last 3 weeks ago
  3. rp 2 times, last 1 month ago
  4. rafael 1 times, last 1 month ago
  5. Alexandru Popa 1 times, last 2 months ago
41 more registered users
20 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.SecurityException

    Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{71740b2 14910:org.xwalk.usecase_cordova_android_tests/u0a363} (pid=14910, uid=10363) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS

    at android.os.Parcel.readException()
  2. Android Platform
    ContentResolver.query
    1. android.os.Parcel.readException(Parcel.java:1620)
    2. android.os.Parcel.readException(Parcel.java:1573)
    3. android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3550)
    4. android.app.ActivityThread.acquireProvider(ActivityThread.java:4778)
    5. android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2018)
    6. android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1468)
    7. android.content.ContentResolver.query(ContentResolver.java:475)
    8. android.content.ContentResolver.query(ContentResolver.java:434)
    8 frames
  3. org.apache.cordova
    ContactManager$1.run
    1. org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:177)
    2. org.apache.cordova.contacts.ContactManager$1.run(ContactManager.java:93)
    2 frames
  4. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    3. java.lang.Thread.run(Thread.java:818)
    3 frames