Hello guys, I wanted to try Compose in my current ...
# compose
j
Hello guys, I wanted to try Compose in my current project, however when I try to build the project I get the following error java.lang.IllegalStateException: Backend Internal error: Exception during code generation Caused by: java.lang.AssertionError: IR backend shouldn’t call KotlinTypeMapper.mapType: EULAFragment (not using any Compose in that Fragment) Any idea why? (If I delete the class the same happens with the next one) If I create a new project it works flawlessly, same with the demo Project JetNews
k
I had the same errors when I applied the compose buildfeature. If you remove this from your build.gradle you can build the project:
Copy code
buildFeatures {
    compose = true
}
j
Thanks a lot!
👍 1
j
You should be able to create a separate module for your Compose widgets, and enable
compose = true
only for the module containing Compose widgets. The issue is that enabling Compose on a module requires enabling Kotlin's new/experimental backend IR, but the new backend is still being built and doesn't yet support all of Kotlin (especially the more advanced features). Minimizing the amount of code you run through the new backend will minimize the likelihood you encounter a bug. Your composable functions must be run with
compose = true
or they will have subtle behavior bugs resulting in unexpected/undefined results.
🙏 2
👍 4
j
Okay, will do that, thank you for the input
k
thanks for clarifying this @jim! Helps a lot, now we see why things happen 🙂 btw the new module is a great idea will try out tonight