Android-Image-Cropper icon indicating copy to clipboard operation
Android-Image-Cropper copied to clipboard

resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE in android 11

Open phamhoanuit opened this issue 3 years ago • 11 comments

When I take photo and click ok step crop image is ignore, close CropImageActivity and resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE

phamhoanuit avatar Mar 29 '21 10:03 phamhoanuit

@phamhoanuit 🚨🚨🚨🚨🚨 THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS 🚨🚨🚨🚨🚨 #818

Canato avatar Mar 30 '21 17:03 Canato

Replace the method getCaptureImageOutputUri in the CropImage.java file with the below code, might solve the problem. it worked for me

public static Uri getCaptureImageOutputUri(@NonNull Context context) { Uri outputFileUri = null; File getImage = context.getExternalCacheDir(); if (getImage != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { outputFileUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", new File(getImage.getPath(), "pickImageResult.jpeg")); } else { outputFileUri = Uri.fromFile(new File(getImage.getPath(), "pickImageResult.jpeg")); } } return outputFileUri; }

sachin-varshney avatar Apr 28 '21 06:04 sachin-varshney

Hey guys, i'm getting Failed to load sampled bitmap: file:///storage/emulated/0/Android/data/com.tayta.par/cache/pickImageResult.jpeg/storage/emulated/0/Android/data/com.tayta.par/cache/pickImageResult.jpeg: open failed: ENOENT (No such file or directory) after take the picture from camera on Motorola One Macro with Android 10. It works from gallery but not from camera. please i need help with this issue

jimmyale3102 avatar May 01 '21 16:05 jimmyale3102

@jimmyale3102 🚨🚨🚨🚨🚨 THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS 🚨🚨🚨🚨🚨 #818

Canato avatar May 01 '21 16:05 Canato

@Canato Thank you, i'll try that

jimmyale3102 avatar May 01 '21 16:05 jimmyale3102

@jimmyale3102 yes, please read the #818

Canato avatar May 01 '21 16:05 Canato

@canato Yes, i am... i will migrate to that library, thank you so much

jimmyale3102 avatar May 01 '21 16:05 jimmyale3102

Replace the method getCaptureImageOutputUri in the CropImage.java file with the below code, might solve the problem. it worked for me

public static Uri getCaptureImageOutputUri(@nonnull Context context) { Uri outputFileUri = null; File getImage = context.getExternalCacheDir(); if (getImage != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { outputFileUri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", new File(getImage.getPath(), "pickImageResult.jpeg")); } else { outputFileUri = Uri.fromFile(new File(getImage.getPath(), "pickImageResult.jpeg")); } } return outputFileUri; }

not working in my case when i tap on button. it's not showing chooser.

devaeon avatar Oct 07 '21 11:10 devaeon

@Muzzamildeveloper read #858 and use the new library, is stable and working

Canato avatar Oct 07 '21 11:10 Canato

@Canato the new library is not stable and not working for android 11

Oussemahlel avatar Nov 08 '21 15:11 Oussemahlel

@Canato the new library is not stable and not working for android 11

Please open an issue on the new library, maybe worth checking the ones that are open. Indeed there are some issues in some devices for Android 11 that I cannot reproduce and people are working on a fix please feel free to help :)

@Oussemahlel

Canato avatar Nov 08 '21 15:11 Canato