joelkanyi / kompose-country-code-picker

Kompose Country Code Picker is a Jetpack Compose library based on Material 3 (M3) that provides a country code picker for Android apps.
https://joelkanyi.github.io/kompose-country-code-picker/
Apache License 2.0
120 stars 13 forks source link

LocalSoftwareKeyboardController Crash #7

Closed Tonnie-Dev closed 11 months ago

Tonnie-Dev commented 11 months ago

I am using Material 3 Version 1.2.0-alpha07 and Compose UI Version 1.5.1 and I am getting this log crash while trying out KomposeCountryCodePicker.

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/ui/platform/LocalSoftwareKeyboardController; at com.joelkanyi.jcomposecountrycodepicker.component.KomposeCountryCodePickerKt.KomposeCountryCodePicker(KomposeCountryCodePicker.kt:74)

Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.ui.platform.LocalSoftwareKeyboardController" on path: DexPathList[[dex file

There is a similar issue that I saw on this unrelated bug report.

When I downgraded MD to 1.1.1 the code did not crash but crucial material three colors could not be resolved e.g. MaterialTheme.colorScheme.surfaceContainerLowest.

I also tried using Integration with TextField but the code still crashed.

Any leads on how to avert this crash will greatly be appreciated.

joelkanyi commented 11 months ago

Let me look into the issues, then will get back to you

joelkanyi commented 11 months ago

I have just created a sample, and all seems well: sample usage

joelkanyi commented 11 months ago

Which stable version of material 3 is this offered? - MaterialTheme.colorScheme.surfaceContainerLowest

Tonnie-Dev commented 11 months ago

Thanks for the prompt review and the tips

After upgrading from Kotlin 1.9.0 -> 1.9.10, Compose Compiler 1.5.0 -> 1.5.3 and Downgrading from Material3:1.2.0-alpha07 -> Material3:1.2.0-alpha03, KomposeCountryCodePicker is now working without crashing

MaterialTheme.colorScheme.surfaceContainerLowest is only available from on Material3:1.2.0-alpha03 onwards. Let me play around with the your Library and I will report in case of any difficulties.

Thanks Man 👍🏽