我正在按照本教程在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 = '[email protected]'
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]
我究竟做错了什么?
谢谢。
最佳答案
这里也可能有问题:
https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle
如果您的回购属于您的组织,那么您将需要userOrg参数集。
请参阅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 uploading binary on bintray
关于android-studio - 使用Bintray在jCenter上发布Android Studio库时遇到问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39975279/