naver / android-imagecropview

android image crop library
Apache License 2.0
254 stars 55 forks source link

(bug android-imagecropview version 1.0.5 ) The application crashes when I choose an image from choose photo option #46

Closed friendsmobile closed 5 years ago

friendsmobile commented 5 years ago

Project Information

Expected behavior

When I try to upload any of the pictures selected by the mobile phone gallery, the app should be uploaded and the app should not crash.

Actual behavior

The application crashes when I choose an image from choose photo option

How to reproduce

Recording Of The Bug

20190722_213618

Logcat

D/AndroidRuntime( 8279): Shutting down VM

E/AndroidRuntime( 8279): FATAL EXCEPTION: main

E/AndroidRuntime( 8279): Process: com.naver.android.helloyako.imagecropsample, PID: 8279

E/AndroidRuntime( 8279): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=99, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:1718 flg=0x1 }} to activity {com.naver.android.helloyako.imagecropsample/com.naver.android.helloyako.imagecropsample.MainActivity}: java.lang.NullPointerException: uriString

E/AndroidRuntime( 8279):    at android.app.ActivityThread.deliverResults(ActivityThread.java:4005)

E/AndroidRuntime( 8279):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:4048)

E/AndroidRuntime( 8279):    at android.app.ActivityThread.access$1400(ActivityThread.java:177)

E/AndroidRuntime( 8279):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1479)

E/AndroidRuntime( 8279):    at android.os.Handler.dispatchMessage(Handler.java:102)

E/AndroidRuntime( 8279):    at android.os.Looper.loop(Looper.java:135)

E/AndroidRuntime( 8279):    at android.app.ActivityThread.main(ActivityThread.java:5910)

E/AndroidRuntime( 8279):    at java.lang.reflect.Method.invoke(Native Method)

E/AndroidRuntime( 8279):    at java.lang.reflect.Method.invoke(Method.java:372)

E/AndroidRuntime( 8279):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)

E/AndroidRuntime( 8279):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

E/AndroidRuntime( 8279): Caused by: java.lang.NullPointerException: uriString

E/AndroidRuntime( 8279):    at android.net.Uri$StringUri.(Uri.java:471)

E/AndroidRuntime( 8279):    at android.net.Uri$StringUri.(Uri.java:461)

E/AndroidRuntime( 8279):    at android.net.Uri.parse(Uri.java:433)

E/AndroidRuntime( 8279):    at com.naver.android.helloyako.imagecropsample.MainActivity.onActivityResult(MainActivity.java:108)

E/AndroidRuntime( 8279):    at android.app.Activity.dispatchActivityResult(Activity.java:6441)

E/AndroidRuntime( 8279):    at android.app.ActivityThread.deliverResults(ActivityThread.java:4001)

E/AndroidRuntime( 8279):    ... 10 more
helloyako commented 5 years ago

Hi, @friendsmobile Thank you for your report.

I know that problem.

But I think it's OK. It's just sample application.

Sample App can load only a picture that is located context://....

android://... can't load.

friendsmobile commented 5 years ago

thanka for your feedback

helloyako commented 5 years ago

Thank you for contacting me :)