Closed Salmancs43 closed 6 years ago
I also getting same error on Nougat. On Activity result I am getting RESULT_ERROR = 96 always. Please suggest me a solution. Before Nougat platform its working fine.
yes its is issue of file exposed exception. i have changed this code with compatible with nougat. you check it out from this link https://github.com/AnkushWalia/EasyAndroidDevelopment/tree/master/ucrop
Yalantis, Please resolve this issue. I am also facing this issue.
Can you take a look on this issue on priority??
have u check that my code in android N??
Yes, I checked it. But I have a huge code and to change the library will take a lot of time. Thats why I was hoping if the issue gets resolved in this one only.
ok ok dear,,, but do you know one thing,,what is issue you have???,, so listen android N having issue of FIle Exposed Exception. so you just change the Uri.Fromfile() method replace to File Provider to get uri of image then your code will be working.
i can't crop capture image. i using ucrop library please give some help.
Thanks Ankush, I will surely try it and let you know.
Ankush, your lib worked like a charm. Now will have to change the whole code.
Thnx
Ankush: Hi, As I said I used your lib. But I am facing another issue in some mobiles like Samsung J7 or moto G 2nd gen etc.
The issue is
FATAL EXCEPTION: AsyncTask #7 Process: com.vastuhfc.ksb.pulse_app, PID: 26929 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/4534-1D1B/DCIM/Camera/20170716_000214.jpg at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:711) at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400) at com.yalantis.ucrop.task.BitmapLoadTask.processInputUri(BitmapLoadTask.java:193) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:99) at com.yalantis.ucrop.task.BitmapLoadTask.doInBackground(BitmapLoadTask.java:50) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)
Please take a look on it asap.
Ok @sarvajeet294 I will check it out after I will surely update you.
@AnkushWalia Did you find anything in it? I am facing huge problem because of it hence I am on your tail. Sorry for bothering you.
No @sarvajeet294 i didn't get the exception. it is a mainly a thread exception so you got illegal argument exception so dont worry its not come every time.
@AnkushWalia In my case in some mobiles, when you select image from Gallery it comes 90% of the times. What do you think, what should I do about it?
@AnkushWalia Thanks a lot. Your solution worked.
However I had to made a little change in your code to get it to work on my App. In FileProvider.getUriFrlmFile, I had to append ".provider" to 2nd parameter. Everything worked fine then. Maybe it's due to my app configurations.
Btw Thanks a lot for your modified library.
Thank you @imhashir
this link is now found https://github.com/AnkushWalia/EasyAndroidDevelopment/tree/master/ucrop i still have this issue
@AnkushWalia I am unable to view this link that has been shared by you. Can you please verify? Still facing the Null Pointer Issue for Nougat and above devices.
Hello which issue u hv got please metion it my gihub directory on issue tab Thanks
On Sat, 2 Dec 2017 at 5:29 PM, quensh93 notifications@github.com wrote:
this link is now found https://github.com/AnkushWalia/EasyAndroidDevelopment/tree/master/ucrop i still have this issue
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Yalantis/uCrop/issues/303#issuecomment-348687450, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab3bz-_nsubsJ5o6tfLFy80oTbVHO1i9ks5s8TuvgaJpZM4NiaJ7 .
@AnkushWalia You had shared a link https://github.com/AnkushWalia/EasyAndroidDevelopment/tree/master/ucrop to view the corrections. I have been to your repository and seen that uCrop library is not being used. Instead, you are using imagepickcrop library. I am facing issue with uCrop and needed help on this issue of File Provider.
Mohit my image crop library is same of crop.. u have to just add my library dependecy on your project and then check it
In Application class onCreate method used this working perfectly !
if(Build.VERSION.SDK_INT>=24){ try{ Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure"); m.invoke(null); }catch(Exception e){ e.printStackTrace(); } }
Fixed at Ucrop 2.2.2
When taking picture from camera and after cropping when i click on save it crashes.