Android App Gradle Build error "Could not find com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2"

Viewed 2926

I am trying to build an Android App, which has dependency on SimpleFingerGestures_Android_Library . The build of the app is getting failed with below error -

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
   > Could not find com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2.
     Required by:
         project

Below is the code where I have included its dependency in build.gradle(app)-

dependencies {
    implementation 'com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2'
}

I have added maven repository also -

    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }

My Trial: After so many hit and try , I found that if I compile with the dependency on previous version of the library than there is no issue. So below code is working for me -

dependencies {
    implementation 'com.github.championswimmer:SimpleFingerGestures_Android_Library:1.1'
}

Problem Summary: I want to include the latest version of SFG that is 1.2 , but build is failing. However build is passing with previous version of SFG Lib that is 1.1.

Note: I am not using AndroidStudio for build, but using command line gradlew utility (because of other Code dependencies). However I have tried with Android Studio also issue is same.

3 Answers

you should add maven { url "https://jitpack.io" } in settings.gradle file.

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

Change com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2 to in.championswimmer:SimpleFingerGestures_Android_Library:1.2, based on the project documentation.

//add in both place
buildscript {
    repositories {
         ....
        maven { url 'https://jitpack.io' }
    }
}

allprojects {
    repositories {
     .......
        maven { url 'https://www.jitpack.io' }
    }
}
Related