Obsolete
Status Update
Comments
za...@gmail.com <za...@gmail.com> #2
You need to temporarily add following to your build.gradle
:
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-Xjvm-default=all",
]
}
}
Note that in certain circumstances you may want to use all-compatibility
instead of all
, learn more about that in
Starting with kotlin 1.6.20 you won't need touch build.gradle
for more information see
ch...@google.com <ch...@google.com> #3
Which of the build.gradle files am I to add the code above as there are 2 build.gradle files
za...@gmail.com <za...@gmail.com> #4
en el Module.
ch...@google.com <ch...@google.com> #5
I have tried adding the code in various places in my Module level build.gradle
but keep receiving the error
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'KotlinCompile' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:85)
at org.gradle.internal.metaobject.ConfigureDelegate.getProperty(ConfigureDelegate.java:130)
Can you please provide a more detailed example of how to use the temporary code within a Module level build.gradle
file?
za...@gmail.com <za...@gmail.com> #6
This is what worked for me. Try adding the code to app level build.gradle
file:
android {
...
kotlinOptions {
...
freeCompilerArgs += [
"-Xjvm-default=all",
]
}
}
za...@gmail.com <za...@gmail.com> #7
deleted
Description
When enabling another compiler plugin on the same project as compose, compose (indirectly) causes a non-descript error to fail the build. In my case, it's using thehttps://github.com/ZacSweers/MoshiX/tree/main/moshi-ir
moshi-ir
plugin from here:Jetpack Compose release version: 1.1.0-rc01 Android Studio Build: N/A command line Kotlin version: 1.6.10
Steps to Reproduce:
moshi-ir simply visits a class and adds a new generated one to the IrFile. As far as I can tell in my internal repro case, there is no compose-related APIs in this subproject nor any files that moshi-IR runs over.