Ktor: Can't run on Android: More than one file was found with OS independent path 'META-INF/ktor-http.kotlin_module'

Created on 20 Jan 2019  路  5Comments  路  Source: ktorio/ktor

Most helpful comment

Can anyone explain this error and why the

packagingOptions {
    exclude 'META-INF/*.kotlin_module'
}

should fix it? 馃槩

All 5 comments

Any update?

same here, after update to ktor 1.2.0

mpp project, heres my gradle sourcesets

```

ext.ktor_version = '1.2.0'
sourceSets {
    commonMain.dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-common:1.3.31"
        implementation "io.ktor:ktor-client-core:$ktor_version"
        implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.2.1"

    }

    androidMain.dependencies {
        implementation "io.ktor:ktor-client-android:$ktor_version"
        implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1"

    }
    iosMain.dependencies {
        implementation "io.ktor:ktor-client-ios:$ktor_version"

    }
}

```
i can only build and running ktor 1.0.0

sorry, beginner mistakes

just add

    packagingOptions {
        exclude 'META-INF/*.kotlin_module'
    }

works for me

Can anyone explain this error and why the

packagingOptions {
    exclude 'META-INF/*.kotlin_module'
}

should fix it? 馃槩

To clarify to future readers of this bug: The magic fixing block needs to be put in the gradle app config under the android section, it seems.

Was this page helpful?
0 / 5 - 0 ratings