mr0xf00 / easycrop

Image cropper for jetpack compose
Apache License 2.0
108 stars 25 forks source link

No direct method <init> in class Landroidx/compose/ui/window/DialogProperties #2

Closed TheMaxKim closed 1 year ago

TheMaxKim commented 1 year ago

Hey there, this looks like a great plugin that I'd like to apply to my own Compose project, but I'm running into the following exception when attempting to utilize the ImageCropperDialog in my own composable:

java.lang.NoSuchMethodError: No direct method <init>(ZZLandroidx/compose/ui/window/SecureFlagPolicy;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Landroidx/compose/ui/window/DialogProperties; or its super classes (declaration of 'androidx.compose.ui.window.DialogProperties' appears in /data/app/~~OIgq0ZZxGZ67M6IqAuq1oQ==/com.example.neverforgetter-XDKjzPGEBSmiiSeNAdqT-w==/base.apk)
        at com.mr0xf00.easycrop.ui.ImageCropperDialogKt.<clinit>(ImageCropperDialog.kt:28)

It looks related to the creation of the DialogProperties here: https://github.com/mr0xf00/easycrop/blob/fa843b69c9a78fe3e9715c1b91c3536a9e057d1a/easycrop/src/main/java/com/mr0xf00/easycrop/ui/ImageCropperDialog.kt#L28-L32

I'm relatively new to Android, but would you happen to know if it's because of a constructor mismatch based on me using a different release of the Compose UI library? (1.4.0-alpha05) : https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/window/AndroidDialog.android.kt;l=96?q=DialogProperties&ss=androidx%2Fplatform%2Fframeworks%2Fsupport:compose%2F

And if so, would there be any way I could contribute to update this library to resolve it, or would you happen to be able to update the version of Compose UI used by this library?

Thanks!

mr0xf00 commented 1 year ago

Yes it does indeed seem that Compose UI 1.3 brought some breaking changes. Please update your setup to EasyCrop 0.1.1 which is using the last Compose release.

TheMaxKim commented 1 year ago

Sweet, no issues now, thanks for the quick fix!