flutter_image_cropper
flutter_image_cropper copied to clipboard
Crash on Android Device when cropping the image in Android version 14
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()'
For my case, the crash happens regardless of API level, but only with release build. It's working fine during the debugging.
I'm facing the same issue even while debugging on Emulator too
same issue
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
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
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"/>
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
has anyone tested if the latest version 9.1 fixes this?