Ktor: Android client requires packagingOptions

Created on 26 Nov 2019  路  3Comments  路  Source: ktorio/ktor

Ktor Version and Engine Used (client or server and name)
Android client, version 1.2.4

Describe the bug
When using the android client in a library inside an Android application, the build fails with the error:

More than one file was found with OS independent path 'META-INF/kotlinx-io.kotlin_module'

The workaround is to add

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

to the applications build.gradle.

The problem is that I'm the distributor of the library and not the applications and trying to migrate from Retrofit to Ktor. Therefore, I can't ask the applications to do that.

bug

Most helpful comment

Hi @baruchn, thanks for the report. We'll fix it in the next minor release.

All 3 comments

Hi @baruchn, thanks for the report. We'll fix it in the next minor release.

This is still present in 1.3.2-1.4-M1-2 for

  • ktor-client-core, ktor-client-json, ktor-http, ktor-http-cio, ktor-io and ktor-utils
  • kotlinx-serialization-runtime

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Was this page helpful?
0 / 5 - 0 ratings