【问题标题】:Uploaded Library to Bintray, but can't be resolved when used将库上传到 Bintray,但使用时无法解析
【发布时间】:2016-04-05 01:02:34
【问题描述】:

我正在按照教程http://code.tutsplus.com/tutorials/creating-and-publishing-an-android-library--cms-24582 上传库。一切正常,它现在在 Bintray 上,正如您在 https://dl.bintray.com/elye-project/maven/ 中看到的那样。

但是,当我尝试按照教程中的第 4 步使用库时,我不断收到以下错误。

Error:(25, 13) Failed to resolve: com.elyeproj.libraries:analogtimerlibrary:1.0.0

我已经检查了我的项目 gradle 中是否有相应的放置

repositories {
    jcenter()
    maven {
        url 'https://dl.bintray.com/elye-project/maven'
    }
}

在我的模块 gradle 中

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.elyeproj.libraries:analogtimerlibrary:1.0.0@aar'
}

可能的问题是什么?我该如何解决?

【问题讨论】:

  • 它对我有用。
  • 谢谢@F43nd1r!这有助于重申图书馆已经出版。我想我做错了什么,我把构建脚本存储库....而不是所有项目存储库。如果这也是您所做的,请随时发布答案,我可以打勾。谢谢!!

标签: android maven gradle publishing


【解决方案1】:

显然我将 maven 存储库放在了错误的部分。我把它放在

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://dl.bintray.com/elye-project/maven'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0-alpha3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

而不是在

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://dl.bintray.com/elye-project/maven'
        }
    }
}

我不知道为什么它适用于教程中的示例库。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-01
    • 2022-06-29
    • 2020-06-22
    • 2017-08-19
    • 1970-01-01
    • 2019-06-27
    • 1970-01-01
    • 2018-08-09
    相关资源
    最近更新 更多