-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Workaround solution for Android 30 #819
Comments
THIS LIBRARY IS NOT MAINTAINED, PLEASE READ THIS #818 I start a new project to handover this library The ideia is that we keep improving because this project don’t have updates since 2018 Open to contribute, next pieces of work will be Android 11 permissions, refactor into Kotlin and ActivityContract OBS: This issue was solved on the new library =) |
@Arise Nice man.. It actually worked.. I was wondering what setOutputUri() is.. Then figured out Uri outputUri = Uri.fromFile(new File(requireActivity().getExternalCacheDir(),"image.jpg"));, if anyone required.. Thanks folk.. |
@Abhishek95872 how you edited the library ? |
@ashcode1997 |
Starting with Android 30 external apps no longer can access directly files, so the solution would be to use a custom file provider.
You will have to do those changes:
In CropImage class, add a string customFileProvider :
Next change getCaptureImageOutputUri function as:
And in getCameraIntent and getCameraIntents you will need to add the permissions as:
In your app, add the true value for:
Just before making your call to the CropImage library:
And at last you need to define the file provider in your AndroidManifest.xml (not going to explain this as is a bit out of the scope).
The text was updated successfully, but these errors were encountered: