使用 Bintray 在 jCenter 上发布 Android Studio 库时遇到问题 [英] Trouble Publishing Android Studio Library on jCenter with Bintray

查看:37
本文介绍了使用 Bintray 在 jCenter 上发布 Android Studio 库时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm following this tutorial to publish an example Android Studio library on Jcenter:

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

看起来很清楚.我已在此链接中使用此库创建了我的 GitHub 存储库:

It seems very clear. I've created my GitHub repository with this library at this link:

https://github.com/alessandroargentieri/mylibview

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

I've also Signed in to Bintray.com, and created a new repository which must contain my library (as explained in the tutorial above).

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

To publish a repository on Bintray I must create an organisation, then you create the repository. So these are my data:

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

Bintray username: alessandroargentieri
organisation: alexmawashi
repository: https://bintray.com/alexmawashi/my_android_repository

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

then, in Android Studio, in the gradle file of my library module, I've this data:

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

When I use the terminal and write: gradlew clean build install bintrayUpload --stacktrace

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

After a few minutes, I get this error:

 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]

我做错了什么?谢谢.

推荐答案

这里也可能有问题:https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.渐变

如果您的存储库属于您的组织,那么您将需要 userOrg 参数集.

If your repo belong to your organisation then you are going to need the userOrg parameter set.

参见 https://github.com/bintray/gradle-bintray-plugin#step-4-add-your-bintray-package-information-to-the-bintray-closure 第 4 步

另见:HTTP/1.1 401 Unauthorized when在 bintray 上传二进制文件

这篇关于使用 Bintray 在 jCenter 上发布 Android Studio 库时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆