我刚接触过Artifactory和Gradle,我遇到了以下问题:
我已经在Artifactory上发布了一个.aar文件,它是以下文件:Lib-调试-1.0.0.aar
现在,我想从一个Gradle项目中解决这个依赖关系,我已经编写了以下代码:
在settings.gradle中,我编写了以下代码:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven {
//name 'Lib-debug-1.0.0.aar'
url 'https://wbste.com/art/IN-DH-commands'
credentials {
username = "user"
password = "pwd"
}
}
jcenter() // Warning: this repository is going to shut down soon
}
}
在app/build.gradle文件中,我编写了以下代码:
allprojects {
repositories {
maven {
//name 'Lib-debug-1.0.0.aar'
url 'https://wbste.com/art/IN-DH-commands'
credentials {
username = "user"
password = "pwd"
}
}
}
}
implementation("com.wfm.egrids:Lib-debug:1.0.0:aar")
生成项目时,将返回以下错误:
FAILURE: Build completed with 3 failures.
1 Task failed with an exception.
-----------
What went wrong:
Execution failed for task ':app:kaptGenerateStubsDevAretiDebugKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task
':app:kaptGenerateStubsDevAretiDebugKotlin'
> Could not resolve all files for configuration ':app:devAretiDebugCompileClasspath'.
> Failed to transform Lib-debug-1.0.0-aar.jar (com.wfm.egrids:Lib-debug:1.0.0) to match attributes {artifactType=android-classes-jar, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find Lib-debug-1.0.0-aar.jar (com.wfm.egrids:Lib-debug:1.0.0).
Searched in the following locations:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0-aar.jar
我似乎在搜索一个.jar文件,但我的文件不是这样的:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0-aar.jar
但这一点:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0.aar
我可以在哪里设置我想要搜索的.jar文件?我如何编写我想要搜索的.aar文件?
如果我写:
implementation(group: 'com.wfm.egrids', name: 'Lib-debug', version: '1.0.0', ext: 'aar')
我得到以下错误:
"Null extracted folder for artifact: ResolvedArtifact"
任何帮助都将得到真正的感谢!两个星期以来,我一直困在这个问题上
发布于 2022-11-28 03:20:10
也许试着替换这一行:
implementation("com.wfm.egrids:Lib-debug:1.0.0@aar")
https://stackoverflow.com/questions/73211528
复制相似问题