-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Composables not transformed by compiler in 1.6.10 #4831
Comments
Did you apply the Kotlin compose compiler plugin? |
Yes, the project works fine with CMP 1.6.2. The only change was bumping the version to 1.6.10. I've seen it in a few projects now. |
Oh do you mean the new one from 2.0? This project is on 1.9.24. |
I tried on my k2 branch and now it does work. The 1.6.10 changelog mentions that the Kotlin compose compiler plugin is needed for Kotlin 2.0-RC2, but this project is on 1.9.24 |
Identified a change causing this behaviour: https://github.com/JetBrains/compose-multiplatform/pull/4604/files#diff-b723358a9cc467fc156c914c8767b75387ca863c0387a2e0850a44e4d1086f18R29 Workaround:
|
…ugins are applied. (#4879) Fix Compose Compiler configuration for Kotlin < 2.0 when kotlin-android or kotlin-js gradle plugins are applied. Fixes #4831 ## Release Notes ### Fixes - Gradle Plugin - Fix Compose Compiler configuration for Kotlin < 2.0 when kotlin-android or kotlin-js gradle plugins are applied.
…ugins are applied. (#4879) Fix Compose Compiler configuration for Kotlin < 2.0 when kotlin-android or kotlin-js gradle plugins are applied. Fixes #4831 ## Release Notes ### Fixes - Gradle Plugin - Fix Compose Compiler configuration for Kotlin < 2.0 when kotlin-android or kotlin-js gradle plugins are applied. (cherry picked from commit c4e3640)
* fix android * import kotlin.reflect.KClass * fixed following JetBrains/compose-multiplatform#4831 (comment) JetBrains/compose-multiplatform#4831 * isStatic = true * macos-13 * Update standalone-sample.yml
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Describe the bug
After updating from CMP 1.6.2 to 1.6.10, Android functions (at least
ComponentActivity.setContent
fromactivity-compose
andComposeContentTestRule.setContent
fromui-test-junit4
) aren't getting transformed by the Compose compiler.If I call either of those
setContent
functions I get aNoSuchMethodError
:and
Notice how
setContent
expects akotlin.jvm.functions.Function0
instead of akotlin.jvm.functions.Function2
, which means that the Compose compiler isn't transforming the library functions. Rolling back to CMP 1.6.2 works, and using the Jetpack Compiler works as well.Versions
To Reproduce
Steps to reproduce the behavior:
./gradlew :samples:simple-portal:android-app:testReleaseUnitTest
The text was updated successfully, but these errors were encountered: