Compose compatibility with shared modules (?). An...
# compose
a
Compose compatibility with shared modules (?). Any ideas on what would cause this, we have some shared code built with Compose 1.5, in our main app we tried moving to 1.6.0-rc01 but one feature in the shared code hits an exception java.lang.NoSuchMethodError: No virtual method getTextAlign-buA522U()Landroidx/compose/ui/text/style/TextAlign; in class Landroidx/compose/ui/text/TextStyle; or its super classes (declaration of 'androidx.compose.ui.text.TextStyle'
I don't have any proguard minification running when i'm testing this either.
The code that hits this is doing this:
Copy code
textStyle.textAlign?.let { align ->
I see this in the 1.6 code:
Copy code
@Deprecated("Kept for backwards compatibility.", level = DeprecationLevel.WARNING)
@get:JvmName("getTextAlign")
@Suppress("unused")
val deprecated_boxing_textAlign: TextAlign? get() = this.textAlign
e
that error sounds more like you have code compiled against 1.6 that is failing to run with a 1.5 library than the other way around
a
it does seem like that deprecated_boxing_textAlign backcompat they added is so if you had code in a old version that would trying to access the nullable textAlign property it would use that. (thats what the code we have complied with 1.5 is doing), but when run in a 1.6 environment its not finding the fallback
e
if that were the issue, you'd be getting a message about missing
getTextAlign
, not the unboxed version (which is why the name is mangled)
oh hmm. actually testing that out, I think the original boxed version also gets name mangled, which surprises me… in that case, that's a compose bug and you should file an issue on the issuetracker
a