-
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
Permissions related error in Android API level 30 #776
Comments
Same problem on Android 11. Pick from gallery working properly, but camera shows permission denied. (Working on Android 10) |
Same =/ |
Oh, Which device did you get this error. I didn't get this in my device (Pixel 2 XL - Android 11) |
I get this error on Pixal 3a, API 30 when I changed my target version in Build file to 30. |
Target version 30...Pixel 3X (I think) API 30 (Android R) |
My app has |
So, the solution is not related to this library, since this library will take the picture after we already have it saved in a URI. The solution for us was change the URI from external to the authority(fileProvider) URI
based on https://developer.android.com/training/camera/photobasics#kotlin Hope this help more people This change was based on the new Android 11 storage permissions https://developer.android.com/about/versions/11/privacy/storage |
Hello @Canato bro! My problem is that nothing is visible when I take a picture from the camera ... So how do you recommend how to put your recommended solution into the library! If you have changed this library to suit you (fork), please share your codes with me too !!! |
@GulmirzaNorboyev Hey =D. This code is not inside the project, I do this before call the crop library So I open the camera before use CropImage library.
Try to open the camera with the google code, after this you can this library to Crop the image |
I can reproduce it in my physical Google Pixel 4 device, and also in Android emulator of Pixel 3a, on API 30. When debugging, I found that the problem does not lie in the permission, but it is because inside the function getCaptureImageOutputUri() in CropImage.java, it is throwing that permission error because there is a null check on the same if statement... so if the url is null it will throw that permission error on the first try, and subsequent try will just crash the app if the permission already granted. I think this library need to apply a fix suggested by @Canato to address this issue |
Looking into the code, we would need to change all BitmapUtils But this is just the first bit, still need more work on it. Get the authority will be already something trick to do. This would fix: |
Hey! I start a new project to handover this library The ideia is that we keep improving because this project don’t have updates since Open to contribute, next pieces of work will be Android 11 permissions, refactor into Kotlin and ActivityContract |
I know this is working great till API Level 29 but in latest API level 30 - I see error after taking picture using camera in my app.
Error is "Cancelling, required permissions are not granted".
Screenshot attaching.
The text was updated successfully, but these errors were encountered: