ArthurHub / Android-Image-Cropper

Image Cropping Library for Android, optimized for Camera / Gallery.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE in android 11

phamhoanuit opened this issue Β· 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 🚨🚨🚨🚨🚨 THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS 🚨🚨🚨🚨🚨 #818

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;
}

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 🚨🚨🚨🚨🚨 THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS 🚨🚨🚨🚨🚨 #818

@Canato Thank you, i'll try that

@jimmyale3102 yes, please read the #818

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

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.

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

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

@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