【问题标题】:Failed to resolve Android Library Bintray JCenter无法解析 Android 库 Bintray JCenter
【发布时间】:2019-03-01 11:24:34
【问题描述】:

我创建了一个 Android 库并上传到 bintray.com

https://bintray.com/vsay01/maven/androidcommonutils

它也是 JCenter 的链接。

在我的应用程序的 gradle 中,我添加了:

implementation 'com.vsay01.utils:androidcommonutils:1.0.0'

在我的项目 gradle 中,我添加了:

allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://dl.bintray.com/vsay01/maven'
        }
    }
}

同步 gradle 时出现错误:

Failed to resolve: androidcommonutils

谁能指出这有什么问题?

[已编辑] 图书馆信息:

ext {
    bintrayRepo = 'maven'
    bintrayName = 'androidcommonutils'

    publishedGroupId = 'com.vsay01.utils'
    libraryName = 'AndroidCommonUtils'
    artifact = 'androidcommonutils'

    libraryDescription = 'Collections of practical Android common utils classes for developer'

    siteUrl = 'https://github.com/vsay01/AndroidCommonUtils'
    gitUrl = 'https://github.com/vsay01/AndroidCommonUtils.git'

    libraryVersion = '1.0.0'

    developerId = 'vsay01'
    developerName = 'Vortana Say'
    developerEmail = 'sayvortana.itc@gmail.com'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}

谢谢

【问题讨论】:

    标签: android gradle android-library bintray


    【解决方案1】:

    artifactId androidcommonutils 下,您只有 .pom 文件并且缺少工件。
    您的工件位于androidutilslibrary 下。

    您需要移动 pom 或工件以使用正确的artifactId

    【讨论】:

    • 谢谢@Royg。这是我的第一个安卓库。您能否提供更多解释或指出此问题发生的原因?是不是因为我编辑的配置并提供了gradle。
    • 这是 artifact !== 您的库的 module 名称的结果(在您的情况下 - androidcommonutils 是工件名称,androidutilslibrary 是模块在您的 gradle 中定义的名称)。这是执行 Royg 建议的技术方式 - 将 pom 和工件移动到一起。
    猜你喜欢
    • 2018-08-26
    • 2015-10-07
    • 1970-01-01
    • 2016-10-08
    • 2022-06-29
    • 2020-06-26
    • 1970-01-01
    • 2017-06-08
    • 1970-01-01
    相关资源
    最近更新 更多