我有一个projectA,它生成AAR,并添加了一个创建jar的任务。我还有另一个依赖于projectA jar的projectB。
我不知道如何使它工作。我收到此错误:
> Could not resolve all files for configuration ':releaseCompileClasspath'.
> Could not find ProjectA-shared.jar (project :ProjectA).
ProjectA :
settings.gradle
rootProject.name = 'ProjectA'
build.gradle
apply plugin: 'com.android.library'
group "com.projecta"
...
task clientJar(type: Jar) {
from "$buildDir/intermediates/javac/release/compileReleaseJavaWithJavac/classes"
//some filter here
appendix "shared"
classifier 'shared'
}
ProjectB :
settings.gradle
rootProject.name = 'ProjectB'
if (new File(rootDir, '../ProjectA').exists()) {
includeBuild '../ProjectA'
}
build.gradle
apply plugin: 'com.android.application'
dependencies {
implementation "com.projecta:ProjectA:1.0:shared@jar"
}
我想在运行projectB的版本时正确获取JAR。