Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE in android 11 #825

Open
phamhoanuit opened this issue Mar 29, 2021 · 11 comments
Open

Comments

@phamhoanuit
Copy link

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

@phamhoanuit phamhoanuit changed the title resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE resultCode return CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE in android 11 Mar 29, 2021
@Canato
Copy link

Canato commented Mar 30, 2021

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

@sachin-varshney
Copy link

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

@jimmyale3102
Copy link

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

@Canato
Copy link

Canato commented May 1, 2021

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

@jimmyale3102
Copy link

jimmyale3102 commented May 1, 2021

@Canato Thank you, i'll try that

@Canato
Copy link

Canato commented May 1, 2021

@jimmyale3102 yes, please read the #818

@jimmyale3102
Copy link

jimmyale3102 commented May 1, 2021

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

@devaeon
Copy link

devaeon commented Oct 7, 2021

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.

@Canato
Copy link

Canato commented Oct 7, 2021

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

@Oussemahlel
Copy link

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

@Canato
Copy link

Canato commented Nov 8, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants