-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
[BUG] -Getting File Not Found Exception when creating new File with cropped uri.getPath() #84
Comments
Hey @RanjitPati I'm on holidays for the next weeks, but this don't look like a library issue. I cannot see the code to create the file, but maybe you can't create the file using the same URI because of the Android Scope Storage, something to check. The bug here would be wrong URI value return, but this is working. Open to discussions so we can solve this and help you =D |
Hi, Hope it helps you too! |
I am creating the file like |
@RanjitPati maybe this is happening because of Android OS permission changes. Now using scope storage we don't get a file path anymore. Maybe you can change the URI string "content" to "file" But is not the real fix, the library will return the URI for the image using the scope storage like google force us now. If you plan to create a file you need to get write storage permission and get the path where you put the image. Make sense? |
com.theartofdev.edmodo:android-image-cropper:2.8.0 |
What I needed was to get Base64 from Uri/Path, originaly I was getting the path but with the change I'm using directly the Uri: Original Code:
New Code:
|
This was the main reason I fork from the old library @AbdulmalekAlshugaa , this was the way it work before OS 11. Now with OS 11, this behaviour changed so the library was updated, not we need to update the usage of it too. Sadly this is an Android OS change, but if anyone know a better fix for the latest OS, using scope storage and keeping it I will close so we focus the discussion on the same place |
Please try the latest |
Describe the bug
I am able to crop the image and put in ImageView successfully.
But when I am using the same URI path to create a file it's throwing
FileNotFoundException
.The URI path is starting like
content://..something/package name/ myfiles/...
something like this.When I debugged I am able to see some data like NO CACHE inside the URI value.
I am pasting my code below:
Calling Method to crop:
Getting cropped result in onActivityResuly()
But the imageview is able to find the path and successfully update the cropped image inside it through Glide.
Expected behavior
I think the cropped Image is not caching and so it's happening like this.
The text was updated successfully, but these errors were encountered: