Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
variyanirav opened this issue Sep 11, 2024 · 7 comments
Open

Comments

@variyanirav
Copy link

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
@lybur
Copy link

lybur commented Sep 30, 2024

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

@jinosh05
Copy link

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

@645638180
Copy link

same issue

@Mar-debug
Copy link

Mar-debug commented Oct 24, 2024

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

@Icaroto
Copy link

Icaroto commented Nov 9, 2024

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

@rajeshbdabhi
Copy link

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

@davemg3
Copy link

davemg3 commented Nov 29, 2024

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 ;
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants