flutter_image_cropper icon indicating copy to clipboard operation
flutter_image_cropper copied to clipboard

Crash on Android Device when cropping the image in Android version 14

Open variyanirav opened this issue 1 year ago • 8 comments
trafficstars

Experiencing Fatal Exception while cropping image on Android 13 and 14, Fatal Exception: java.lang.IncompatibleClassChangeError: Class 'android.content.res.XmlBlock$Parser' does not implement interface 'e8.a' in call to 'int e8.a.l()'

Screenshot 2024-09-11 at 1 08 52 PM Screenshot 2024-09-11 at 1 09 52 PM

variyanirav avatar Sep 11 '24 07:09 variyanirav

For my case, the crash happens regardless of API level, but only with release build. It's working fine during the debugging.

lybur avatar Sep 30 '24 05:09 lybur

I'm facing the same issue even while debugging on Emulator too

jinosh05 avatar Oct 17 '24 23:10 jinosh05

same issue

645638180 avatar Oct 18 '24 04:10 645638180

I also seem to get crashing on android when debugging or in release -- the android version does not matter for me too, have been having this issue for a while

Edit: I saw that by adding the UCropActivity in my AndroidManifest.xml file the cropper worked and is no longer causing the app to crash Screenshot 2024-10-24 at 10 43 26

Mar-debug avatar Oct 24 '24 07:10 Mar-debug

Any other possible solutions for this? My Manifest (in the main folder) contains the activity but I still get the issue on release apk and not on debug

Icaroto avatar Nov 09 '24 00:11 Icaroto

i am facing same issue even i added below code to my manifest

<activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait" android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

rajeshbdabhi avatar Nov 19 '24 10:11 rajeshbdabhi

Having the same from version 5.0.1 to version 8.0.2 Temporarily, waiting for a fix from the author, i am using this in my proguard and it works pretty well (courtesy of claude.ai) :

`

Keep UCrop and related classes

-keepclassmembers class com.yalantis.ucrop.** { ; } -keep class com.yalantis.ucrop.* { ; } -keep class androidx.appcompat.view.* { ; } -keep class androidx.appcompat.widget.* { ; } -keep class androidx.appcompat.app.* { ; } -keep class androidx.core.content.* { *; }

Keep XML related classes

-keep class android.content.res.XmlBlock$Parser { ; } -keep class android.content.res.XmlResourceParser { ; } -keep class org.xmlpull. { *; }

Keep menu related classes

-keep class * extends android.view.Menu { *; } -keep class * extends android.view.MenuItem { *; }

General rules for androidx

-keep class androidx.** { ; } -keep interface androidx.* { ; } -keep class android.content.res.* { ; } -keep class vv.* { *; }

Keep potential interface implementations

-keep interface * { *; } -keepclassmembers class * implements android.os.Parcelable { static ** CREATOR; }

Keep all fragments for UCrop

-keepclassmembers class * extends androidx.fragment.app.Fragment { public (); }

Keep required xml attributes

-keepclasseswithmembers class *.R$ { public static ; } `

davemg3 avatar Nov 29 '24 12:11 davemg3

has anyone tested if the latest version 9.1 fixes this?

marcucio avatar Apr 10 '25 15:04 marcucio