'No read access to repo Jitpack error

My Github account is private. I'm trying to create a dependency in Jitpack of my github repo project. But its throwing "No read access to repo" error. Can anyone help me to fix this.

https://i.stack.imgur.com/Y12ds.png



Solution 1:[1]

According to the JitPack website, in order to use private repositories via JitPack, you need to authorize JitPack on GitHub and add your token into $HOME/.gradle/gradle.properties in the following format:

authToken=AUTHENTICATION_TOKEN

Then use authToken as the username in your build.gradle file:

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

Solution 2:[2]

Refer this link for granting read access to your Github/Bitbucket/Gitlab private repositories : https://jitpack.io/docs/PRIVATE/#set-up

For reference:

To start using private repositories you will first need to grant JitPack access. Open https://jitpack.io/private and follow the steps:

  1. Click Authorize to get your personal authentication token. Each member of your team should to get their own token.
  2. Add the token to $HOME/.gradle/gradle.properties:

authToken=AUTHENTICATION_TOKEN

  1. Then use authToken as the username in your build.gradle:

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Piotr Wittchen
Solution 2 pravingaikwad07