Just hit this using 1.5.0-rc01 and the MP material...
# compose-ios
s
Just hit this using 1.5.0-rc01 and the MP material 3 datepicker stuff:
java.lang.NoSuchMethodError: No static method rememberDatePickerState
Project builds fine, but the exception occurs (in debug and release builds) in a Composable that calls rememberDatePickerState to set up the datepicker stuff. I've seen this working before in MP, like in beta01 or 02. So I'm suspicious of something in rc01 but am unsure. Tomorrow I will start diagnosing, and will post again if I find more. Anyone else having a problem using rememberDatePickerState function in MP? FYI the import is:
import androidx.compose.material3.rememberDatePickerState
And Android Studio shows it's resolved by the klib below, but runtime fails:
org.jetbrains.compose.material3-material3-1.5.0-rc01-commonMain-m5L1mQ.klib
👍 1
1
Nope, still broke in beta02 when support for datepicker started, and in rc02. So, maybe this is because I'm still also using the android-specific compose material3 in my android module, so it overlaps with the MP compose libs in the uiCommon module. Looks like the method signature for
rememberDatePickerState
has a new argument
selectableDates
in 1.6.0-alpha03.
selectableDates
argument is NOT in compose MP material 3's def for the same function. Don't know when this new argument was added in android Compose. This different signature for the same method must be messing with the MP code at run time.
fun rememberDatePickerState(
@Suppress("AutoBoxing") initialSelectedDateMillis: Long? = null,
@Suppress("AutoBoxing") initialDisplayedMonthMillis: Long? = initialSelectedDateMillis,
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = object : SelectableDates {}
): DatePickerState
I'll look at this more tomorrow. I'm guessing I'll need to figure out which Compose release has the original signature and go back to it for now.
FYI for anyone interested I filed https://github.com/JetBrains/compose-multiplatform/issues/3545. So we'll see what happens :-)
d
We answered in Issue. But feel free to ask more questions related to your problem
s
I saw that, thanks for the info about this starting in 1.2.0-alpha02. Is there a plan yet for when CMP will support 1.2.0 Material 3?
d
Yes - when it will be stable. We will support it as well