https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Joey

12/26/2019, 2:45 AM
Copy code
* What went wrong:
A problem occurred evaluating settings 'sample-kt-sharedlib'.
> Could not find method enableFeaturePreview() for arguments [GRADLE_METADATA] on settings 'sample-kt-sharedlib' of type org.gradle.initialization.DefaultSettings.
Any suggested solution to this? Im trying to upload a multiplatform lib to bintray. Thanks! B-)
y

yshrsmz

12/26/2019, 3:26 AM
just remove it GRADLE_METADATA is stable on your gradle version, thus it throws error
r

russhwolf

12/26/2019, 3:38 AM
Are you missing quotes? Should be
enableFeaturePreview("GRADLE_METADATA")
j

Joey

12/26/2019, 3:39 AM
@yshrsmz i tried to remove it and now it says
Copy code
* What went wrong:
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.multiplatform', version: '1.3.61']
> Failed to apply plugin [id 'org.jetbrains.kotlin.multiplatform']
   > Could not create plugin of type 'KotlinMultiplatformPluginWrapper'.
      > org/gradle/api/internal/FeaturePreviews
@russhwolf i have the quotes 😄
r

russhwolf

12/26/2019, 3:43 AM
Are you using the bintray gradle plugin? If so, what version? The default one won’t work for multiplatform. There’s a hacked version that JetBrains uses internally as well as some other libs, but in general the community seems to be moving away from it toward just using maven-publish.
j

Joey

12/26/2019, 3:44 AM
Im using this version
Copy code
id 'com.jfrog.bintray' version '1.8.4'
and i am also following this tutorial
Copy code
<https://natanfudge.github.io/fudgedocs/publish-kotlin-mpp-lib.html>
Upgrading my gradle to version 6.0.1 solves the issue. Thanks guys! 🙂
👍 1
Hi guys, i have successfully implemented the kotlin multiplatform library in my old pure java project but i cant find/import the classes in my library. Do i need to declare something in my kotlin mp lib? Thanks
d

Dominaezzz

12/26/2019, 11:36 AM
You have Java files in your mpp project? Then you need to use
withJava()
j

Joey

12/26/2019, 11:49 AM
No i dont have java files. Only kotlin files. Specifically commonMain, iosMain, and jvmMain. I tried to enable kotlin plugin in my pure java project and created a
sample.kt
to test whether kotlin can use the functions of the imported library. And, yes it can use but when i try to call the functions in an Activity (
MainActivity.java
) it says cannot resolve
Im looking at kotlin and java interoperability rn
5 Views