kapt still can't be used together with compose? I ...
# compose
m
kapt still can't be used together with compose? I tried 0.1.0-dev04 still gets
Copy code
e: java.lang.NoSuchMethodError: org.jetbrains.kotlin.codegen.state.GenerationState$Builder.isIrBackend(Z)Lorg/jetbrains/kotlin/codegen/state/GenerationState$Builder;
https://issuetracker.google.com/u/1/issues/143232368 https://youtrack.jetbrains.com/issue/KT-34583
I've already had
Copy code
kotlinCompilerExtensionVersion "0.1.0-dev04"
adding
Copy code
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
ended up in even more cryptic compiler error
j
What was the even more cryptic compiler error?
m
Caused by: java.lang.AssertionError: Unexpected IR element found during code generation. Either code generation for it is not implemented, or it should have been lowered: FUNCTION_REFERENCE 'private final fun onInject$lambda-0 ($this$onInject: org.foxglove.profile.ui.fragment.EditProfileFragment, it: android.text.Editable?): kotlin.Unit declared in org.foxglove.profile.ui.fragment.EditProfileFragment' type=kotlin.Function1<android.text.Editable?, kotlin.Unit> origin=LAMBDA
I don't think it is even kapt or compose that fails
If I comment out the said method it fails at other place with similar error
j
Hmm, yeah, I assume none of the mentioned classes/packages is Compose related? That error looks like it might be a bug in the IR backend, which is still experimental/incomplete, but either way it looks like a legitimate bug. If you're able to reduce the offending code to a minimal repo, we can file a bug against the IR backend to have it investigated further. As a workaround, if you can move that code into a non-compose package (assuming it is not related to Compose), you can turn off the IR backend in that package, and depend on it from your compose widgets.
m
full output
thanks I'll try to break it down what causes the error and extract a minimal project for showcase
Till then I'll use kapt and compose in different modules
j
👍
m
I could locate two kinds of error in my code (I'll create the sample project of that) but good news is getting rid of that kapt and compose worked together 🙂
@jim https://github.com/mateherber/backend-exception-experimental-compiler/blob/master/sample/src/main/java/org/foxglove/application/RootActivity.kt Here you can find the project and in the activity two different blocks of code that ends up in build failure
j
The first code block is related to coroutines, which are known to be incomplete. The second code block is more interesting, digging into it now. Thanks for posting!