我无法使用TouchImageView依赖。

3
我正在尝试使用适用于Android的TouchImageView依赖项。我无法使用类中的函数,并在日志中出现以下错误[1]:https://github.com/MikeOrtiz/TouchImageView

任务执行失败,出现异常。

  • 失败原因: 任务“:hideItPro:mergeDebugNativeLibs”的执行失败。

无法解析配置“:hideItPro:debugRuntimeClasspath”中的所有文件。 无法解析com.github.MikeOrtiz:TouchImageView:1.1.1。 由以下内容所需: 项目:hideItPro > 无法解析com.github.MikeOrtiz:TouchImageView:1.1.1。 > 无法获取资源'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'。 > 从服务器接收到状态代码403:“Forbidden”

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。 使用--info或--debug选项运行以获取更多日志输出。 使用--scan运行以获取完整的洞察力。 ==============================================================================

  • https://help.gradle.org获取更多帮助

此构建中使用了已弃用的Gradle功能,使其与Gradle 7.0不兼容。 使用“--warning-mode all”显示各个弃用警告。 请参阅https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 27s 303个可操作任务:270个已执行,33个最新

2个回答

1
在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"

这对我起作用了。

0
在项目的build.gradle文件中添加Maven仓库。
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

在应用程序的 build.gradle 文件中添加依赖项。
dependencies {
    ...
    implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1' // last SupportLib version
    // or
    implementation 'com.github.MikeOrtiz:TouchImageView:$LAST_VERSION' // Android X
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接