Dhaval2404 / ImagePicker

📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UCropActivity Crash Android 4.4 (KiKat)

OPunktSchmidt opened this issue · comments

I'm not able to take a photo or pick a image from the gallery. Every time it crashes before the the Crop-Activity shows up. The camera opens but after the photo is taken the App crashes and no Crop-Activity shows up.

Android Version: 4.4
Device: x86 Emulator

Logs:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{opunktschmidt.myapp/com.yalantis.ucrop.UCropActivity}: android.content.res.Resources$NotFoundException: File res/drawable/ucrop_ic_cross.xml from drawable resource ID #0x7f0800ce at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java)

Caused by android.content.res.Resources$NotFoundException: File res/drawable/ucrop_ic_cross.xml from drawable resource ID #0x7f0800ce
       at android.content.res.Resources.loadDrawable(Resources.java:2101)
       at android.content.res.Resources.getDrawable(Resources.java:700)
       at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:456)
       at com.yalantis.ucrop.UCropActivity.setupAppBar(UCropActivity.java:346)
       at com.yalantis.ucrop.UCropActivity.setupViews(UCropActivity.java:297)
       at com.yalantis.ucrop.UCropActivity.onCreate(UCropActivity.java:126)
       at android.app.Activity.performCreate(Activity.java:5231)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
       at android.app.ActivityThread.access$800(ActivityThread.java:135)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5017)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
       at dalvik.system.NativeStart.main(NativeStart.java)

Caused by org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877) at android.content.res.Resources.loadDrawable(Resources.java:2097) at android.content.res.Resources.getDrawable(Resources.java:700) at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:456) at com.yalantis.ucrop.UCropActivity.setupAppBar(UCropActivity.java:346) at com.yalantis.ucrop.UCropActivity.setupViews(UCropActivity.java:297) at com.yalantis.ucrop.UCropActivity.onCreate(UCropActivity.java:126) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(NativeStart.java)

Same here! There is an related issue in Yalantis/uCrop#529, which was closed.

The issue has been resolved in uCrop v2.2.5. These changes will be reflected in v2.0. Thank you!

Upgrade uCrop to v2.2.5