Here we go. The journey has started. <https://gith...
# confetti
a
Here we go. The journey has started. https://github.com/joreilly/Confetti/pull/860
👍 1
j
does that serialization issue happen even without K2 enabled?
a
I didn't try with K2. I wanted to make sure first that K2 works fine.
It looks like on K1, the serialization plugin doesn't work with Compose plugin on iOS.
j
I'm using serialization plugin and Compose for iOS in following.....maybe some version difference https://github.com/joreilly/FantasyPremierLeague
something to do with default values it seems d so maybe that's the difference
a
But in Confetti we don't have default values for configurations in the shared module.
Even a simple class with just one Int property fails to compile.
On iOS. Android is fine.
j
I tried to compare projects but couldn't see what difference is affecting this
a
Weird. Check this issue: https://github.com/JetBrains/compose-multiplatform/issues/2635 In that case there was interference with the compose plugin, which generated invalid IR and caused serialization to fail afterwards. Maybe in this case another plugin causes the issue.
We could try disabling plugins one by one.
j
I copied
Config
glass in to FantasyPremierLeague and still not seeing issue running
compileKotlinIosSimulatorArm64
there.....strange
a
Yeah, there must be a compiler plugin in Confetti that messes with serialization
j
I saw issue but then if I updated versions to ones we have then it works! I'm trying to break it again now
a
Yep. It appears that issue was due to a bug in Compose plugin, which was fixed. I suspect now we have another plugin that has a similar bug. Or maybe it's just a tricky bug in serialization.
So many issues with compiler plugins. 😁 with great power comes great responsibility.
j
found this issue....it was related to compose compiler plugin
I had forced use of the androidx version at one point to be compatible with particular kotlin version
so, you need to update main
build.gradle.kts
to comment out following
Copy code
//allprojects {
//    configurations.all {
//        resolutionStrategy.dependencySubstitution {
//            substitute(module("org.jetbrains.compose.compiler:compiler")).apply {
//                using(module("androidx.compose.compiler:compiler:${libs.versions.compose.compiler.get()}"))
//            }
//        }
//    }
//}
and use following in share build file
Copy code
kotlinCompilerPlugin.set(libs.versions.jbComposeCompiler.get())
will be great at some point if we can have one common compose compiler dependency for both Jetpack Compose and Compose Multiplatform!
a
Oh great!
Why do we need different versions? Why do we need Jetpack Compose at all? I've been using Multiplatform Compose in all my samples.
j
yeah, might be possible to do that
a
Ok, I'll try. Thanks!
j
looks a lot cleaner!
you ok for me to merge the PR?
a
So the PR is now green on K1. We could merge. And then I open a separate PR with enabling K2 and file compiler bugs.
j
sounds good
a
Also there might be a concern. Wait
Developers may be looking at Confetti for Decompose integration, but it uses the dev version
So it might be confusing.
j
yeah, we can hold off as well if you prefer
a
I don't mind either way
Let me extract compose changes to a separate PR
So that new things would be built on top
j
ok
a
Once merged, I will update the Parcelize branch
j
that's merged now
a
Awesome! Updated the K2 branch and actually enabled K2 there. Should start failing now.
👍 1
j
do you think that k2 issues now are related to other parts of the apps/libs etc?
a
The current error looks related to Compose.
Copy code
e: file:///home/runner/work/Confetti/Confetti/shared/src/androidMain/kotlin/dev/johnoreilly/confetti/ui/SessionDetailsViewSharedWrapper.kt:8:5 Symbol @Composable() fun SessionDetailViewShared(session: SessionDetails?, onSpeakerClick: (@R|kotlin/ParameterName|(name = String(speakerId))  String) -> Unit, onSocialLinkClicked: (String) -> Unit): Unit is invisible
It can't call the internal composable function.
Removing named arguments from lambda doesn't help 😞
Maybe report this bug for Compose?
j
yeah, I can do that....I'll try a few things here first to see if any workaround
a
I think in this case we could just expose the internal function and remove the wrapper. Perhaps, it should be working since recently. But before that maybe still report 🙂
j
I think I ran in to some issues that required that but will take a look again
related to usage on iOS
in general the guidance seems to be to mark as much as possible in shared code as iinternal to reduce size of framework
not sure then if that affects use of K2
a
That makes sense. Then perhaps filing a bug is necessary.
j
If I remove internal from
SessionDetailViewShared
here I see other errors then....
I might have go at trying latest 19.20 beta version
a
Yes, there are more compiler errors after that
j
trying
1.9.20-Beta-205
here (with later version of compose compiler as well) and seem to be getting further....can build/run compose desktop app but having some other issues with ios/android clients
👀 1
a
If I comment out the
SessionDetailViewShared
call, then I managed to compile
androidApp
. Without changing the Kotlin version.
Though, there are lots of warnings like:
Copy code
WARNING: D8: An error occurred when parsing kotlin metadata. This normally happens when using a newer version of kotlin than the kotlin version released when this version of R8 was created. To find compatible kotlin versions, please see: <https://developer.android.com/studio/build/kotlin-d8-r8-versions>
WARNING: D8: Unexpected error during rewriting of Kotlin metadata for class 'dev.johnoreilly.confetti.sessiondetails.ComposableSingletons$SessionDetailsViewKt$lambda-1$1':
com.android.tools.r8.internal.A10: Should never be called
j
With Kotlin 1.9 20 version?
a
1.9.10, the current one
j
looks like official 1.9.20-Beta release on it's way with a ton of K2 fixes https://github.com/JetBrains/kotlin/releases/tag/v1.9.20-Beta
a
Nice! I will try that tonight.
I couldn't try Kotlin 1.9.20-Beta, because Compose 1.5.2.1-Beta is not yet published (see here). Also the following config didn't work for some reason:
Copy code
compose {
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.9.20-Beta")
}
I got
Compose Multiplatform 1.5.1 doesn't support Kotlin 1.9.20-Beta
even with that config.
j
I'll check what I had here for that 1.9.20 beta dev version I had tried
ok, I think this is working (compiler plugin version from https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/comp[…]in/kotlin/org/jetbrains/compose/ComposeCompilerCompatibility.kt) This is with just desktop enabled in settings.gradle.kts so far.....will try others now
Copy code
compose {
    kotlinCompilerPlugin.set("1.5.2.1-Beta")
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.9.20-Beta")
}
hmm, getting for android app still
ah, it was androidTest that needed it
as wall as androidApp it seems
so I've added to shared/compose-desktop/androidApp and androidTest....not sure if needed in all those places
hmm, so that was just with sync'ing....if I try to run android app I get
Copy code
This version (1.5.2) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.20-Beta which is not known to be compatible.  Please consult the Compose-Kotlin compatibility map located at <https://developer.android.com/jetpack/androidx/releases/compose-kotlin> to choose a compatible version pair (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
that looks to be related to commoncar
I commented out
compose = true
in that for now and get further at least....now seeing
Copy code
Named arguments are not allowed for function types
a
The thing is that Compose Compiler plugin v1.5.2.1-Beta is not yet published. If it would, there would be no need to use
suppressKotlinVersionCompatibilityCheck
.
So I think either wait for
v1.5.2.1-Beta
to become available and just bump the version to that one. Or use
suppressKotlinVersionCompatibilityCheck
without changing the Compose Compiler version.
j
That seems available here
Is it not for you?
a
a
Yep, now it's published!
Ah ok, it's just the compiler, not compose gradle plugin
j
and if I update
HomeRoute
(to not use named params) then android app builds/runs fine !
a
I managed to build Android and iOS (with some changes)
Let me push my updates
j
ah, nice
a
Pushed
j
just ran them here...very cool!
btw looks like we're getting following for wear app as well
Copy code
This version (1.5.2) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.20-Beta which is not known to be compatible.  Please consult the Compose-Kotlin compatibility map located at <https://developer.android.com/jetpack/androidx/releases/compose-kotlin> to choose a compatible version pair (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
a
I will check
I have fixed Wear App. But I also discovered an issue. We are now using Compose Multiplatform on Android. And I also did the same for Wear app. It seems that Android Studio doesn't show Compose Previews panel in those modules now.
So we might want to revert Android and Wear app modules back to Jetpack Compose.
j
ah, interesting
just also confirmed that release android/wear builds are working in your branch as well
a
Thanks for checking! I haven't tried running apps yet.
j
a
Wohoo! Great achievement! I suggest to wait for a first alpha release of Decompose before merging. There are also a bug in Decompose related to
kotlinx-serialization
, I will fix soon.
👍 1
j
btw if/when you go back to using jetpack compose for android/wear the androidx compose compiler version (that works with Kotlin 1.9.20-beta) is here now https://androidx.dev/storage/compose-compiler/repository
👍 1
a
Status update. I'm planning to release a first alpha version of Decompose with kotlinx-serialization in the coming days. So we could finally merge that PR with K2 support. :-)
🥳 2
I have updated Decompose to v.1.2.0-alpha01 and pushed the changes. If green then I think we could merge the PR. 😀
👍 1
j
Just merged.....we now have K2 support (thanks to @Arkadii Ivanov)!!
a
Yay! 🙌