I have moved some of my Compose code from Android ...
# compose-ios
I have moved some of my Compose code from Android app into shared code to re-use on iOS. Having an issue running the Android app. I get a crash when trying to use OutlinedTextField from material3. Specifically trying to set colors with TextFieldDefaults. The error is:
Copy code
java.lang.NoSuchMethodError: No virtual method outlinedTextFieldColors-l59Burw(JJJJJLandroidx/compose/foundation/text/selection/TextSelectionColors;JJJJJJJJJJJJJJJJJJJJJJLandroidx/compose/runtime/Composer;IIII)Landroidx/compose/material3/TextFieldColors; in class Landroidx/compose/material3/TextFieldDefaults; or its super classes (declaration of 'androidx.compose.material3.TextFieldDefaults' appears in /data/app/~~FYGMycCQdYFPIoh1dtOFsA==/com.webappclouds.salonbiz-F3ecxD59PfZsacrUUWg4Gg==/base.apk)
Like it is not included in the multiplatform compose. Odd is that it does build just fine. If I try to use the material (2) version, it works but not all the colors are being changed like I ask for. In the shared library I am using 1.5.0-dev1071 and in the main android app I am using 1.5.0-beta02 (and material 1.2.0-alpha02). Is this perhaps a known issue.
👍 1
Seems like the issue is that
version of Compose Multiplatform supports only material3
, so 1.2.0-alpha02 may not work there
I am curious, how did you determine the material3 version? Is it listed somewhere on the repo?
Sure, you can check it here in the source code: https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/gradle.properties#L96 For releases (not dev builds) we post it separately in Change Notes e.g. https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.4.0 — Dependencies part
Great, thanks! Hope they get material3 up to date soon. The Material 2 OutlinedTextField is missing some color overrides which I need...