2

I am trying out the 14 days trial of Jitpack.io so that I can use my Android Libraries on gitlab through gradle in my production apps.

So what I basically have: 2 Android apps on GitLab 2 Android Libraries on GitLab

I am currently importing them by (settings.gradle):

include ':app',':library'
project(':library').projectDir = new File(settingsDir, 'some_/long/path')

build.gradle:

    implementation project(':library')

Which is obviously quite troublesome. So I did:

  1. I followed the 'setup' part on the original docs
  2. I followed the 'Gitlab' part on the original docs

I think everything was quite well setup because I saw my repositories at the homepage on the left hand side so I went to the private page to test out if I could get it to work. I also obviously did what was told in the private section.

So my files looked like this:

gradle.properties (nothing, basically that line):

authToken=my_super_secret_token_generated_by_gitlab

project build.gradle:

    maven {
        url "https://jitpack.io"
        credentials { username authToken }
    }

And then my build.gradle in my app:

implementation 'com.gitlab.organization:library:master'

But then I get a strange unauthorized error, I don't know why. My Access Token has API access and when I fill in the token in Jitpack it also shows a green checkmark. See my error below:

Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.gitlab.organization:library:master.
  Required by:
      project :app
   > Could not resolve com.gitlab.organization:library:master.
      > Could not get resource 'https://jitpack.io/com/gitlab/organization/library/master/library-master.pom'.
         > Could not GET 'https://jitpack.io/com/gitlab/organization/library/master/library-master/libary-master.pom'. Received status code 401 from server: Unauthorized

Does someone has any idea why it is unauthorized? I got to say library is in a subgroup, so I have tried many other ways to try to resolve it but It did not really help.

Karl-John Chow
  • 775
  • 2
  • 8
  • 26
  • Hi @Karl-John Chow, I am trying to distribute my android libraries through Jitpack. I am using GitLab. Please provide me the detailed steps to publish the library to Jitpack. I didn't see any detailed documentation for Gitlab. – SKK Apr 27 '20 at 10:41
  • @SKK https://jitpack.io/private this helps you – Karl-John Chow Apr 28 '20 at 01:59
  • Hi, Can you tell me that how can I create personal libs. I try to do but getting nothing – Jaydip Oct 08 '20 at 10:28

1 Answers1

3

The "authToken" need to be generated by jitpack user profile and not from gitlab

Moti
  • 462
  • 2
  • 6
  • 18