2

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

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

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

https://github.com/alessandroargentieri/mylibview

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

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

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

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'

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]

What am I doing wrong? Thanks.

Alessandro Argentieri
  • 2,901
  • 3
  • 32
  • 62

2 Answers2

4

There also might be a problem here: https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle

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

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

Also see: HTTP/1.1 401 Unauthorized when uploading binary on bintray

Community
  • 1
  • 1
galusben
  • 5,948
  • 6
  • 33
  • 52
  • I was surprised I wasn't able to create a repo without creating an Organisation first. I thonk I'm missing something. I must say aso that the bintray.com site has changed from the screenshot you can see on every tutorial. I'll try to insert userOrg into the contents of the first link (moving them to my GitHub repo and let you know... – Alessandro Argentieri Oct 12 '16 at 09:40
  • Execution failed for task ':mylittlelibrary:bintrayUpload'. > Could not create package 'alexmawashi/my_android_repository/mylittlelibrary': HTTP/1.1 400 Bad Request [message:No release notes file found under this GitHub path] – Alessandro Argentieri Oct 12 '16 at 13:03
3

For this to work properly, your gradle.properties file needs to have a bintray.user and a bintray.apikey (which is your bintray API key) configured (see the include in https://raw.githubusercontent.com/nisrulz/JCenter/master/bintrayv1.gradle )