coomar2841 / image-chooser-library

An Easy Image/Video Chooser Library for your Android Apps
646 stars 192 forks source link

Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider #8

Closed korniltsev closed 8 years ago

korniltsev commented 11 years ago

2013-08-22 12 10 32

Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider from ProcessRecord{411c6770 20120:com.beanie.imagechooserapp/u0a10161} (pid=20120, uid=10161) requires com.google.android.gallery3d.permission.GALLERY_PROVIDER or com.google.android.gallery3d.permission.GALLERY_PROVIDER at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2545) at android.app.ActivityThread.acquireProvider(ActivityThread.java:4648) at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2054) at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1101) at android.content.ContentResolver.query(ContentResolver.java:356) at android.content.ContentResolver.query(ContentResolver.java:315) at com.beanie.imagechooser.api.BChooser.getAbsoluteImagePathFromUri(BChooser.java:112) at com.beanie.imagechooser.api.ImageChooserManager.processImageUri(ImageChooserManager.java:216) at com.beanie.imagechooser.api.ImageChooserManager.processImageFromGallery(ImageChooserManager.java:252) at com.beanie.imagechooser.api.ImageChooserManager.submit(ImageChooserManager.java:198) at com.beanie.imagechooserapp.ImageChooserActivity.onActivityResult(ImageChooserActivity.java:120) at android.app.Activity.dispatchActivityResult(Activity.java:5293) at android.app.ActivityThread.deliverResults(ActivityThread.java:3443) ... 11 more

korniltsev commented 11 years ago

I was trying to find workaround for taking pictures from picase and got the same exception Then I found the lib and it crashes too

Detailed message says Permission Denial: opening provider com.android.gallery3d.provider.GalleryProvider from ProcessRecord{40fe4f08 19199:drug.vokrug/u0a10153} (pid=19199, uid=10153) requires com.google.android.gallery3d.permission.GALLERY_PROVIDER or com.google.android.gallery3d.permission.GALLERY_PROVIDER

However setting the permission does not help

coomar2841 commented 11 years ago

Looks like a bug on Android:

https://code.google.com/p/android/issues/detail?id=47741

But, will have a look at it.

coomar2841 commented 11 years ago

@kurganec Could you check this solution and see if it works? I can't reproduce the problem on my phone. See the answer with the most upvotes.

korniltsev commented 11 years ago

@coomar2841 there is no way I can set singleTask on my activity.

coomar2841 commented 11 years ago

Hmm... Does this happen only on this particular device? Or you can reproduce on other devices/oses as well? I would need to reproduce this problem on one of my devices, and then I could look into a workaround. I have a Nexus S running 4.2.2 and a Galaxy Nexus on 4.3

wlrover commented 10 years ago

Guys, have you found a solution for this issue as I am facing the same problem when I am trying to share a file into my app using gallery app. I don't have "singleTask" in my manifest.

korniltsev commented 10 years ago

Still no solution

AndroidDeveloperLB commented 9 years ago

Only possible solutions that I can think of are:

  1. The easy solution: add those permissions . not sure why it doesn't work for me.
  2. the hard solution: save the needed data somewhere (depends on what you need), and also have a fallback to reading from files paths. I'm not sure, but maybe you don't even need to get the metadata (orientation etc...) , and using the ExifInterface is enough (depending if it works and what are your needs).

I think one way to test it is by taking an image from Picasa, using a Uri. the first few times you access it, it will work fine, but soon afterwards, you have a good chance of getting an exception.

coomar2841 commented 8 years ago

This should be fixed now. Please check and re-open if it's still an issue.