updated to 0.6.2 and im still getting `Error:(33, ...
# kotlin-native
h
updated to 0.6.2 and im still getting
Error:(33, 0) Platform project project ':android' has more than one 'expectedBy' dependency: project ':common', project ':common-frontend'
g
As I understand, this is problemt that you cannot implement two common modules with one platform module. This is fixed in 1.2.40, probably not merged to KN
h
https://github.com/JetBrains/kotlin-native/releases/tag/v0.6.2 suggests this has been resolved, unless im reading it wrong
g
oh, I see
i
Could you please provide your
build.gradle
?
h
which one?
i
The
gradle.build
of your
:android
project. Do you use Kotlin/Native or Kotlin/JVM for this project?
h
Copy code
apply plugin: 'com.android.application'
apply plugin: 'kotlin-platform-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27

    defaultConfig {
        applicationId "au.com.timmutton"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
        }
    }
}

ext {
    supportVersion = '27.0.2'
    retrofitVersion = '2.3.0'
}

dependencies {
    expectedBy project(':common')
    expectedBy project(':common-frontend')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"

    implementation "com.android.support:appcompat-v7:$supportVersion"

    implementation "com.google.code.gson:gson:2.8.2"

    implementation "io.reactivex.rxjava2:rxjava:2.1.8",
            "io.reactivex.rxjava2:rxandroid:2.0.1"

    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion",
            "com.squareup.retrofit2:converter-gson:$retrofitVersion",
            "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion",
            'com.squareup.okhttp3:logging-interceptor:3.4.1'
}
i
You are using Kotlin/JVM for Android (
kotlin-platform-android
plugin), not Kotlin/Native in this project. As Andrey said this issue should be resolved in 1.2.40-eap (see the changelog: https://github.com/JetBrains/kotlin/releases/tag/v1.2.40-eap-16). What version of
kotlin-platform-android
are you using?
h
kotlin version is 1.2.30, kotlin native gradle plugin is 0.6.2
i
Several
expectedBy
dependencies are not supported in Kotlin prior to
1.2.40
. So try to change the Kotlin version to
1.2.40-eap-16
. You also may have to include the kotlin-eap repo in your project. To do it just add the following snippet in your top-level `build.gradle`:
Copy code
buildscript {
    repositories {
        maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
    }
}

allprojects {
    repositories {
        maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
    }
}
👍 1
h
that seems to have done the trick, thanks mate