camera click image not coming in result on android 11
error in result while picking camera image on android 11
Failed to load sampled bitmap: file:///storage/emulated/0/Android/data/com.hhstudio/cache/pickImageResult.jpeg File is not a picture
@geeta4 please check:
https://github.com/ArthurHub/Android-Image-Cropper/issues/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; }
How to get the actual file path from the FileProvider.getUriForFile() How do I get path like file:///storage/emulated/0/Android/data/com.hhstudio/cache/pickImageResult.jpeg
Please help me if there is any solution.
How to get the actual file path from the FileProvider.getUriForFile() How do I get path like file:///storage/emulated/0/Android/data/com.hhstudio/cache/pickImageResult.jpeg
Please help me if there is any solution.
@Softkeydel please read #818
The new version has a method for it
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; }
thank you very much. This works for me also
how to change that file, because its read only file