https://kotlinlang.org logo
#compose
Title
# compose
i

itnoles

04/29/2020, 9:07 PM
When I tried to assembleDebug in dev10, I gets incompatible kotlin api error that is asking for 1.4
l

Leland Richardson [G]

04/29/2020, 9:52 PM
can you give more details on this?
i

itnoles

04/30/2020, 2:08 AM
"w: Runtime JAR files in the classpath have the version 1.3, which is older than the API version 1.4. Consider using the runtime of version 1.4, or pass '-api-version 1.3' explicitly to restrict the available APIs to the runtime of version 1.3. You can also pass '-language-version 1.3' instead, which will restrict not only the APIs to the specified version, but also the language features"
l

Leland Richardson [G]

04/30/2020, 2:47 AM
what is the kotlin runtime version you are using?
i

itnoles

04/30/2020, 2:47 AM
1.3.72
l

Leland Richardson [G]

04/30/2020, 2:49 AM
can you paste your whole gradle config for me?
i

itnoles

04/30/2020, 2:50 AM
root/build.gradle or app/build.gradle?
l

Leland Richardson [G]

04/30/2020, 2:51 AM
in this case i actually kinda need both
i

itnoles

04/30/2020, 2:53 AM
j

jim

04/30/2020, 8:23 AM
Just a shot in the dark, but we were using kotlin version
1.3.70
in our smoketest, you might consider downgrading to
1.3.70
instead of
1.3.72
, not sure if that will solve your issue though. You an also try suppressing the message with the flag they suggested in the message (
-language-version 1.3
) or maybe try skipping the runtime check (
-Xskip-runtime-version-check
). The root cause of the error is that we're getting super close to the Kotlin 1.4 release, but Kotlin 1.4 isn't released yet so you can't easily depend upon it, so you mostly need to suppress the warnings until it's released. Here is a gradle config fragment that might help (it's what we're using for a similar warning in androidx):
Copy code
allprojects {
  tasks.withType(KotlinCompile).configureEach {
        kotlinOptions {
            freeCompilerArgs += ["-Xskip-runtime-version-check"]
        }
    }
}
You could also try a Kotlin preview release candidate like
1.4-M1
for the runtime. We're in a bit of a twilight zone as we get closer to Kotlin 1.4. Please do post in the group if you find a configuration that works for you, as that may help others with similar constraints/setups.
i

itnoles

04/30/2020, 4:07 PM
I tried to use 1.4-M1, it didn't work.
l

Leland Richardson [G]

04/30/2020, 4:25 PM
Try 1.3.70. It looks like some folks are having luck with that?
i

itnoles

04/30/2020, 5:52 PM
I tried to use 1.3.70, I get same warnings
l

Leland Richardson [G]

04/30/2020, 5:58 PM
does the warning prevent successful compilation?
i

itnoles

04/30/2020, 6:00 PM
No
l

Leland Richardson [G]

04/30/2020, 6:04 PM
ok. i think we might just have to live with this warning for this release. We are in a wierd middle ground where the compiler isn’t really 1.3 and it’s not really 1.4 either, which makes some of these warnings a bit nonsensical. We will be moving closer to 1.4 very soon where i believe the line will be less blurred.
2 Views