Anyone having trouble with multi-platforms project...
# multiplatform
e
Anyone having trouble with multi-platforms projects and
1.3.10
? I'm getting this: (if it makes any difference, I'm using the Gradle Kotlin DSL)
Copy code
> Task :common:compileKotlinCommon FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':common:compileKotlinCommon'.
> Could not resolve all files for configuration ':common:compileClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.10.
     Required by:
         project :common
      > Cannot choose between the following variants of org.jetbrains.kotlin:kotlin-stdlib-common:1.3.10:
          - compile
          - enforced-platform-compile
          - enforced-platform-runtime
          - platform-compile
          - platform-runtime
          - runtime
        All of them match the consumer attributes:
          - Variant 'compile':
              - Found org.gradle.component.category 'library' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-api'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
          - Variant 'enforced-platform-compile':
              - Found org.gradle.component.category 'enforced-platform' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-api'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
          - Variant 'enforced-platform-runtime':
              - Found org.gradle.component.category 'enforced-platform' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-runtime'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
          - Variant 'platform-compile':
              - Found org.gradle.component.category 'platform' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-api'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
          - Variant 'platform-runtime':
              - Found org.gradle.component.category 'platform' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-runtime'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
          - Variant 'runtime':
              - Found org.gradle.component.category 'library' but wasn't required.
              - Found org.gradle.status 'release' but wasn't required.
              - Required org.gradle.usage 'kotlin-api' and found compatible value 'java-runtime'.
              - Required org.jetbrains.kotlin.platform.type 'common' but no value provided.
r
I think the Kotlin DSL is known to be incompatible with the multiplatform plugin, but I haven't tried it myself so that might have changed recently.
h
Is it Gradle 5.0-rc? There's a known issue with Kotlin 1.3.10 and Gradle 5.0-rc, you need to either use Kotlin 1.3.0 or Gradle 4.10.2 until it's fixed: https://youtrack.jetbrains.com/issue/KT-28203
e
ohhhh
yeah I'm using 5.0-rc3!
thanks @h0tk3y
s
I’ve been having this issue as well, glad I found this!
h
The fix should be available in Gradle 5.0-rc4, according to the comments on the issue mentioned above.
🎉 1
e
@h0tk3y there's a similar-ish issue that apparently happened between Gradle
4.10.1
and
4.10.2
, where when trying to compile Kotlin I get (using
<...>
as a placeholder for "some classes"):
Copy code
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class <...>, unresolved supertypes: <...>
    class <...>, unresolved supertypes: <...>

e: <...>.kt: (6, 12): Unresolved reference: <...>
e: <...>.kt: (27, 15): Unresolved reference: <...>
h
@Eugenio Please check your projects for
implementation
dependencies: those are not exposed for dependent modules' compilation. See this issue and comments: https://youtrack.jetbrains.com/issue/KT-28223
🙏 1