Hi all, i am trying to avoid a 1.4.32 -> 1.5.0 ...
# compose-desktop
u
Hi all, i am trying to avoid a 1.4.32 -> 1.5.0 kotlin update by building my multiplatform module with compose-desktop “0.4.0-build208”. For some reason I still get this error:
Copy code
> Task :shared:compileKotlinJvm
e: This version (1.0.0-beta08) of the Compose Compiler requires Kotlin version 1.5.0 but you appear to be using Kotlin version 1.4.32 which is not known to be compatible.  Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
Any hints where “1.0.0-beta08" could be coming from? And how to set the Compose Compiler version in non-android projects?
j
1.0.0-beta08 is the version of the Compose Compiler that is matches the Compose-Desktop 0.4.0-build208 build. If you're going to want to use that build of Compose-Desktop, you're going to need to bump up to Kotlin 1.5.0 for compatibility.
u
Which one should I use for kotlin 1.4.32 then? “0.4.0-build198”?
j
Yeah, looking at the commit log, I think build198 would still be Kotlin 1.4.32.  But you're going to need to update sooner or later.  May I ask what's holding you back?
u
It’s temporary. Just somme dependency issues that I need to get sorted out. A case of going back to where it builds and then attacking the update to 1.5.0.
👍 1
thanks for your quick response.
👍 1
c
Out of curiosity: i guess if I have a multiplatform project with android and desktop, I cannot upgrade kotlin as jetpack on Android is still not on beta8?
j
If you have an MPP project, you are using the MPP binaries published by Jetbrains, which includes all the binaries you need for Android and already has Kotlin 1.5.0 support.
So if you have an MPP project, you can be ahead of the curve and there is nothing stopping you from using Kotlin 1.5.0 today. If you are building an android-only app using the binaries that Google publishes, then you need to wait for Kotlin 1.5.0 to be supported.
👍 3
m
So in MPP can I even use Android specific compose libraries in Android module? I successfully used accompanist-coil. But when I try to use accompanise-swiperefresh I get this error:
Copy code
java.lang.NoSuchFieldError: No field Square of type Landroidx/compose/ui/graphics/StrokeCap; in class Landroidx/compose/ui/graphics/StrokeCap; or its superclasses (declaration of 'androidx.compose.ui.graphics.StrokeCap' appears in /data/data/com.swissborg.android/code_cache/.overlay/base.apk/classes.dex)
        at com.google.accompanist.swiperefresh.CircularProgressPainter.onDraw(CircularProgressPainter.kt:90)
        at androidx.compose.ui.graphics.painter.Painter.draw-x_KDEd0(Painter.kt:212)
        at androidx.compose.ui.draw.PainterModifier.draw(PainterModifier.kt:289)
...
j
So in MPP can I even use Android specific compose libraries in Android module?
Yes, exactly right. Or more specifically, you can use Android specific code in the Android source sets of any given MPP module.
I successfully used accompanist-coil. But when I try to use accompanise-swiperefresh I get this error
That inline class isn't even android specific (it lives in common code). I'm not sure what's going wrong there. You could try doing a clean build to see if that helps, but that might be a bit optimistic. Sounds like maybe a bug or version mismatch between Accompanist and Compose. We might need to call in @cb or file a bug. If you're able to create a minimal repro, we can investigate further.
m
Ok I will try to create a minimal project to reproduce. Swipe to refresh indicator is visible and works fine but as soon as it's going away this crash happens
c
The issue was probably because Compose Desktop was probably ahead/behind the Jetpack Compose version which Accompanist depends on. There’s been a few binary changes lately. Hopefully this should be working now with the latest versions.