Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.89k stars 2.16k forks source link

i got an Exception while crop image from camera on android N #282

Closed chandanitnou closed 6 years ago

chandanitnou commented 7 years ago

Hello uCrop team i got the Exception bellow:

D/BitmapWorkerTask: copyFile E/BitmapWorkerTask: Copying failed java.io.FileNotFoundException: /

please fix it thanks.

mengxn commented 7 years ago

you just try this UCrop.of(inputUri, outputUri) .withAspectRatio(1, 1) .withMaxResultSize(100, 100) .start(getActivity()); and outputUri = Uri.fromFile(file)

Salmancs43 commented 7 years ago

Hi did you find this solution?

rostopira commented 7 years ago

Suggesting to add little hack to the library: https://stackoverflow.com/a/42437379/5593959

if(Build.VERSION.SDK_INT>=24){
   try{
      Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
      m.invoke(null);
   }catch(Exception e){
      e.printStackTrace();
   }
}
Legementarion commented 6 years ago

fixed at last release