Я пытаюсь создать проект Android Library с последним плагином Android Gradle и с трудом понимаю, какую ошибку он мне выдает. Моя установка - это модуль Java, модуль библиотеки Android и второй модуль библиотеки Android. Все они находятся в одном проекте.
Блок зависимостей модуля C:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':moduleA')
implementation project(':moduleB')
}
Gradle синхронизируется нормально, а assemble
выполняется правильно. Я использую Gradle 4.6 (пробовал также с 4.4) и Android Gradle Plugin 3.1.2. Проблема возникает как в Android Studio, так и на Jenkins. При попытке запустить uploadArchives
я получаю следующую ошибку:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':moduleC:uploadArchives'.
> Could not publish configuration 'archives'
> Could not resolve all files for configuration ':moduleC:archives'.
> Could not resolve project :moduleB.
Required by:
project :moduleC
> Cannot choose between the following configurations of project :moduleB:
- debugApiElements
- debugRuntimeElements
- releaseApiElements
- releaseRuntimeElements
All of them match the consumer attributes:
- Configuration 'debugApiElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-api' but wasn't required.
- Configuration 'debugRuntimeElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'debug' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-runtime' but wasn't required.
- Configuration 'releaseApiElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-api' but wasn't required.
- Configuration 'releaseRuntimeElements':
- Found com.android.build.api.attributes.BuildTypeAttr 'release' but wasn't required.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Found com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but wasn't required.
- Found org.gradle.usage 'java-runtime' but wasn't required.