Home > Back-end >  Android gradle fails to resolve jitpack snapshot build dependency
Android gradle fails to resolve jitpack snapshot build dependency

Time:01-14

I had a GitHub project forked and some fixes applied to it. Now would like to use it as dependency in a project of mine. Have followed the instructions provided at jitpack.io but gradle build fails to find it.

build.gradle (all projects)

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

build.gradle (module)

dependencies {
    implementation 'com.github.user:repo:e91058a'
}

Have tried calling File->Sync in Android Studio and running gradlew build --refresh-dependencies. Also tried defining dev-SNAPSHOT as the version number instead of commit hash. But it always ends up with Failed to resolve error.

What am I missing here?

CodePudding user response:

Check your repositority on jitpack.io, and verify that the snapshot was actually built. (Enter your repo url, select 'branches', you must see a green icon near your commit sha) Also if your repository is private, you'd need to add access token in build.gradle (you can find it in ur account setting)

  •  Tags:  
  • Related