Android не может изменить зависимости конфигурации ': compile' после того, как она была включена в разрешение зависимостей - PullRequest
0 голосов
/ 14 ноября 2018

Я не смог собрать модуль библиотеки на Android-студии. Я получил следующее исключение в файле build.gradle:

Cannot change dependencies of configuration ':smack-android:compile' after it has been included in dependency resolution.

* Where:
Build file '/Users/...../build.gradle' line: 15

Я использую Android studio 3.2.1, а версия Gradle - 4.6

build.gradle:

dependencies {
    // androidProjects lists all projects that are checked to compile against android.jar
    // Filter out the optional Smack dependencies from androidProjects
    androidProjects.findAll {
        ![':some-module'].contains(it.getPath())
    }.each { project ->
        compile project // Line no 15 exception occurred
    }
}

compileJava {
    options.bootClasspath = androidBootClasspath
}

// See http://stackoverflow.com/a/2823592/194894
// TODO this doesn't seem to work right now. But on the other hand it
// is not really required, just to avoid a javadoc compiler warning
javadoc {
    options.linksOffline "http://developer.android.com/reference", androidJavadocOffline
}

configure (androidProjects) {
    task compileAndroid(type: JavaCompile) {
        source = compileJava.source
        classpath = compileJava.classpath
        destinationDir = new File(buildDir, 'android')
        options.bootClasspath = androidBootClasspath
    }
}

test { dependsOn androidProjects*.compileAndroid }

Любая помощь в этом?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...