简体   繁体   中英

Kotlin Multiplatform on IntelliJ is trying to download native dependencies every time

Every time I create a new Kotlin Multiplatform (Mobile shared Library) project in IntelliJ and run Gradle sync, Gradle tries to download native dependencies. This process is long and unsuccessful. Here are some examples of what Gradle is trying to do:

在此处输入图片说明 在此处输入图片说明 在此处输入图片说明

It makes every sync very long (several minutes). How do I make it stop?

I'm using Gradle 5.1.

As pointed out by @yole, this is a known issue but now there is a workaround. Here is a full implementation of the workaround in Groovy :

repositories {
    mavenCentral().content() {
        excludeGroup "Kotlin/Native"
    }
    google().content() {
        excludeGroup "Kotlin/Native"
    }
    jcenter() {
        content {
            excludeGroup("Kotlin/Native")
        }
    }
    maven { 
        url 'https://jitpack.io'
        content {
            excludeGroup("Kotlin/Native")
        }
    }
}

and in Kotlin DSL :

repositories {
        mavenLocal().apply {
            content {
                excludeGroup("Kotlin/Native")
            }
        }
        maven {
            url = uri("https://dl.bintray.com/soywiz/soywiz")
            content {
                includeGroup("com.soywiz")
                excludeGroup("Kotlin/Native")
            }
        }
        jcenter() {
            content {
                excludeGroup("Kotlin/Native")
            }
        }
        google().apply {
            content {
                excludeGroup("Kotlin/Native")
            }
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM