With Kotlin 1.3 I'm seeing the following error wit...
# multiplatform
s
With Kotlin 1.3 I'm seeing the following error with mpp:
The Feature "multi platform projects" is experimental and should be enabled explicitly
. How do I enable multi platform projects explicitly in the gradle file? The IDE is of no use here.
a
Check out this ticket which shows how to pass command-line flags to native and all other multiplatform targets:
I believe the flag you want is
-Xuse-experimental=kotlin.Experimental
l
Do you see this in a project containing an Android target? If so, and the Gradle build passes successfully, then it’s an IDE bug, which will be fixed in upcoming Kotlin 1.3-RC
s
I see this in the
commonMain
source set of a mpp project that has a common and Android module.
@ankushg That doesn't work when adding that to my
org.gradle.jvmargs
in my
gradle.properties
@Liliia Any recommendations for how to work around it for now? I filed a bug against it earlier: https://youtrack.jetbrains.com/issue/KT-26903
l
Unfortunately, there is no workaround for it, this is a tooling bug (https://youtrack.jetbrains.com/issue/KT-26356 and related) which is fixed in upcoming Kotlin 1.3-RC. Nevertheless, you can try out the latest build from the corresponding branch: https://teamcity.jetbrains.com/viewLog.html?buildId=1619921&tab=artifacts&buildTypeId=Kotlin_130_CompilerAllPlugins — download a proper plugin for your IDE, then in IDE go to
Settings > Plugins > Install plugin from disk...
and select the downloaded plugin. It should be considered as a dev build, so no guaranties on its stability, but so does the dev builds which are used in the new multiplatform samples (https://github.com/h0tk3y/k-new-mpp-samples), therefore nothing new here. If you want to update Gradle dependency as well, set it to
1.3.0-rc-26
, with all the rest settings in the sample projects left as is, it should also work.
s
thx