I am unable to use TouchImageView dependency

Viewed 716

I'm trying to use the dependency of TouchImageView for android. I'm unable to use the functions in the class and getting this error in Log [1]: https://github.com/MikeOrtiz/TouchImageView

Task failed with an exception.

  • What went wrong: Execution failed for task ':hideItPro:mergeDebugNativeLibs'.

Could not resolve all files for configuration ':hideItPro:debugRuntimeClasspath'. Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1. Required by: project :hideItPro > Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1. > Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'. > Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'. Received status code 403 from server: Forbidden

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 27s 303 actionable tasks: 270 executed, 33 up-to-date

2 Answers

In settings.gradle

   dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
//here the dependency
            maven { url 'https://jitpack.io' }
            jcenter() // Warning: this repository is going to shut down soon
        }
    }
    
    include ':app'
    rootProject.name = "Apk"

this worked for me

Add maven repository in project build.gradle file,

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

Add dependencies in app build.gradle file,

dependencies {
    ...
    implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1' // last SupportLib version
    // or
    implementation 'com.github.MikeOrtiz:TouchImageView:$LAST_VERSION' // Android X
}
Related