【问题标题】:Trouble Publishing Android Studio Library on jCenter with Bintray使用 Bintray 在 jCenter 上发布 Android Studio 库时遇到问题
【发布时间】:2017-02-19 21:05:31
【问题描述】:

我正在按照本教程在 Jcenter 上发布示例 Android Studio 库:

http://crushingcode.co/publish-your-android-library-via-jcenter/

看起来很清楚。 我在这个链接上用这个库创建了我的 GitHub 存储库:

https://github.com/alessandroargentieri/mylibview

我还登录了 Bintray.com,并创建了一个必须包含我的库的新存储库(如上面的教程中所述)。

要在 Bintray 上发布存储库,我必须创建一个组织,然后您创建存储库。所以这些是我的数据:

Bintray 用户名:alessandroargentieri
组织:alexmawashi
存储库:https://bintray.com/alexmawashi/my_android_repository

然后,在 Android Studio 中,在我的库模块的 gradle 文件中,我有以下数据:

apply plugin: 'com.android.library'

ext {
    bintrayRepo = 'my_android_repository'       //maven
    bintrayName = 'mylibview'   // Has to be same as your library module name

    publishedGroupId = 'mawashi.alex.mylittlelibrary'
    libraryName = 'MyLibView'
    artifact = 'mylibview'     // Has to be same as your library module name

    libraryDescription = 'Android Library to use a custom view'

    // Your github repo link
    siteUrl = 'https://github.com/alessandroargentieri/mylibview'
    gitUrl = 'https://github.com/alessandroargentieri/mylibview.git'
    githubRepository= 'alessandroargentieri/mylibview'

    libraryVersion = '1.0'

    developerId = 'alexmawashi'
    developerName = 'Alessandro Argentieri'
    developerEmail = 'alexmawashi87@gmail.com'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]
}
...
...
apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle'

当我使用终端并写下: gradlew clean build install bintrayUpload --stacktrace

几分钟后,我收到此错误:

 What went wrong:
Execution failed for task ':mylittlelibrary:bintrayUpload'.
> Could not create package 'alessandroargentieri/my_android_repository/mylibview': HTTP/1.1 404 Not Found [message:Repo 'my_android_repository' was not found]

我做错了什么? 谢谢。

【问题讨论】:

  • 我第一次尝试时也遇到了这个错误,因为我把存储库名称和库名称弄混了。 Here is my solution.
  • 谢谢!我会尽快尝试您的解决方案!

标签: android-studio bintray jcenter


【解决方案1】:

为使其正常工作,您的 gradle.properties 文件需要配置 bintray.user 和 bintray.apikey(这是您的 bintray API 密钥)(请参阅 https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle 中的包含)

【讨论】:

    【解决方案2】:

    【讨论】:

    • 我很惊讶如果不先创建组织就无法创建存储库。我想我错过了什么。我必须说,bintray.com 网站已从您在每个教程中看到的屏幕截图发生了变化。我会尝试将 userOrg 插入到第一个链接的内容中(将它们移动到我的 GitHub 存储库并让您知道...
    • 任务 ':mylittlelibrary:bintrayUpload' 执行失败。 > 无法创建包“alexmawashi/my_android_repository/mylittlelibrary”:HTTP/1.1 400 错误请求 [消息:在此 GitHub 路径下找不到发行说明文件]
    猜你喜欢
    • 2015-02-24
    • 2017-06-08
    • 2017-04-14
    • 2018-08-26
    • 1970-01-01
    • 2017-11-14
    • 2019-03-01
    • 2016-09-25
    • 2017-08-19
    相关资源
    最近更新 更多