【发布时间】:2020-04-01 17:48:01
【问题描述】:
我已将 maven publish 添加到运行正常的库项目中,并且它正在 .m2/repository 中生成 .aar 文件 现在我正在尝试将该库添加到我的应用项目中,但它给出了错误。
这是我的 build.gradle(app's)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:perf-plugin:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
和 common.gradle(我在其中实现该库)像这样
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Use project(":libraryName") if you need to test changes to library in development.
implementation project(":libraryName")
}
我遇到的错误
ERROR: Unable to resolve dependency for ':mobile@prodDebugUnitTest/compileClasspath': Failed to transform artifact 'library.aar (project :libraryName)' to match attributes {artifactType=jar}.
【问题讨论】:
标签: android maven android-studio gradle