-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Issue on Android Q #543
Comments
@raylee4204 have you handled runtime permissions? I'm on Android Q as well and I don't get a crash. |
I have handled runtime permissions. This occurs when I pass a device image's uri from my app to uCrop.
|
The error looks like it's saying the file does not exist Does the following work for you? //Select photo
Inside
|
Is your build target android Q? The following is from the android developers documents about scoped storage on Q: Even with the Storage permission, such an app that accesses the raw file-system view of an external storage device has access only to the app's raw, package-specific path. If an app attempts to open files outside of its package-specific path using a raw file-system view, an error occurs: In managed code, a FileNotFoundException occurs. |
Yes, my build target is Q Did you use the code to select a photo
Or are you using a hardcoded file path? |
Selecting photo via intent works fine. I have a custom bottom sheet that shows a grid of photos located on device via following
|
Hmm, not sure. I'm actually not in any way associated with uCrop - was just trying to help. This library doesn't seem to be too actively maintained although it's a great library. |
I currently turned on legacy mode because of this. Although Q is still in beta, their API has been finalized. I'm hoping I can hear from the steam |
@raylee4204 did you try to launch the demo app on the same device where you got an error? |
I encountered this issue recently, also on Android 10. I managed to reproduce it locally and trace it through with the debugger. As @raylee4204 mentioned, the root cause does seem to be the new scoped file access in Android 10. In particular, when dealing with a Interestingly, this issue doesn't seem to occur if you haven't granted It would seem that the easiest fix would be to stop using Disclaimer: I haven't studied the library code in depth, so I could easily be missing something. |
@TermLog I installed the sample app on the same device that I was experiencing issues with when using the uCrop library with my app that targets API 29. There were no problems when selecting the same files that caused my app to crash. However, I noticed that the sample app targets API 28. When I modified it to API 29, it did crash on those same files. |
Yup it throws the FileNotFoundException without legacy mode in Android Q |
I can confirm as well that this worked previous on Android 8, targeting API level 29. But on Android 10, targeting API 29, it fails with the same callstack. Is there a timeline on a fix for this? |
Same issue:
|
Same issue here:
|
Any update on this issue? @GamelyAnthony solution does work, but even the documentation specifies that it should only be used while app is not compatible with scoped storage. |
@Yalantis hope to adapt soon,thks! |
Same issue here: Google Pixel 3 XL, Android 10 |
I was facing the same problem. Now i have found the solution. Check out here: |
@blessedCode07 It seems to be redundancy, but it is effective. thks, hope it helps somebody. |
@HanGao1 这个不给适配android 10,目前你们咋处理的,是暂时使用legacy mode? |
The solution is effective. I parse the media uri to Bitmap, then save the bitmap to a File in app externalCacheDir, and get the file uri by Uri.fromFile(new File(bitmapFilePath));. and last transform the uri to ucrop library. It seems to be redundancy, but it is effective. thks, hope it helps somebody. |
I'm now using this library. Seems to be second best in terms of design and at least it works with scoped storage. https://github.com/ArthurHub/Android-Image-Cropper |
Duplicate to #598 |
<manifest ... > from: https://medium.com/@sriramaripirala/android-10-open-failed-eacces-permission-denied-da8b630a89df |
Launching Ucrop with image URI from a device image on Android Q throws Permission denied error:
This only occurs on android Q devices when the target sdk version is 29
The text was updated successfully, but these errors were encountered: