gpt4 book ai didi

android - mavenLocal不从.m2存储库中获取 Artifact

转载 作者:行者123 更新时间:2023-12-03 05:05:00 24 4
gpt4 key购买 nike

我已经将maven publish添加到我的库项目中,该项目工作正常,并且正在.m2 / repository中生成.aar文件。
现在,我正在尝试将该库添加到我的应用程序项目中,但是会出现错误。

这是我的build.gradle(app)

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}.

最佳答案

尝试包括*.aar

implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

或者你可以这样实现:
implementation "com.yourlibrarygroup.id:artifactoryname:0.0.1@aar"

关于android - mavenLocal不从.m2存储库中获取 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60977136/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com