【问题标题】:Android App Gradle Build error "Could not find com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2"Android App Gradle 构建错误“找不到 com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2”
【发布时间】:2021-07-30 16:29:50
【问题描述】:

我正在尝试构建一个依赖于 SimpleFingerGestures_Android_Library 的 Android 应用程序。应用程序的构建失败并出现以下错误 -

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

下面是我在 build.gradle(app) 中包含其依赖项的代码-

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

我还添加了 maven 存储库 -

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

我的试用: 经过这么多的尝试后,我发现如果我使用对以前版本的库的依赖进行编译,则没有问题。所以下面的代码对我有用-

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

问题摘要:我想包含最新版本的 SFG,即 1.2 ,但构建失败。然而,构建正在通过以前版本的 SFG Lib 1.1。

注意:我没有使用 AndroidStudio 进行构建,而是使用命令行 gradlew 实用程序(因为其他代码依赖项)。但是我尝试过使用 Android Studio 也有同样的问题。

【问题讨论】:

    标签: android build build.gradle android-build


    【解决方案1】:

    com.github.championswimmer:SimpleFingerGestures_Android_Library:1.2 更改为in.championswimmer:SimpleFingerGestures_Android_Library:1.2,基于the project documentation

    【讨论】:

    • 我已经尝试过这个仍然构建错误Could not find in.championswimmer:SimpleFingerGestures_Android_Library:1.2.。但是,如果我对 1.1 版本(即in.championswimmer:SimpleFingerGestures_Android_Library:1.1)使用相同的版本,则不会出错。
    • @shivi: 确保您对repositories 的更改是在 repositories -- 在标准的Android Studio 项目中,它将是@ 中的那个顶级build.gradle文件中的987654328@。除此之外,请确保您遵循项目文档,如果仍有问题,请联系项目开发人员。
    【解决方案2】:
    //add in both place
    buildscript {
        repositories {
             ....
            maven { url 'https://jitpack.io' }
        }
    }
    
    allprojects {
        repositories {
         .......
            maven { url 'https://www.jitpack.io' }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2018-11-06
      • 2016-01-17
      • 1970-01-01
      • 2018-05-29
      • 1970-01-01
      • 1970-01-01
      • 2015-04-24
      • 1970-01-01
      • 2016-06-03
      相关资源
      最近更新 更多