jdamcd / android-crop

Android library project for cropping images
4.54k stars 1.08k forks source link

Crashing crop activity with below exceptions for android 6.0: #222

Closed hetang closed 8 years ago

hetang commented 8 years ago

Fatal Exception: java.lang.SecurityException: Permission Denial: writing com.google.android.apps.photos.contentprovider.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F554/ORIGINAL/NONE/2031015553 from pid=9018, uid=10111 requires the provider be exported, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1620) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:146) at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:621) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:960) at android.content.ContentResolver.openOutputStream(ContentResolver.java:702) at android.content.ContentResolver.openOutputStream(ContentResolver.java:678) at com.soundcloud.android.crop.CropImageActivity.saveOutput(CropImageActivity.java:382) at com.soundcloud.android.crop.CropImageActivity.access$900(CropImageActivity.java:45) at com.soundcloud.android.crop.CropImageActivity$5.run(CropImageActivity.java:311) at com.soundcloud.android.crop.CropUtil$BackgroundJob.run(CropUtil.java:193) at java.lang.Thread.run(Thread.java:818)

Lawgrin commented 8 years ago

Do you have both read and write permission before calling the crop function? If not, please add it. esp with the security changes to android 6

hetang commented 8 years ago

Thanks it works now. I have to move the permission. Needs to ask before calling crop.