当前位置: 首页 > 知识库问答 >
问题:

Android/Gradle构建失败:找不到依赖项

缪嘉志
2023-03-14

我不知道该怎么办;我卡住了。我有以下依赖关系,以前一切都很好:

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:recyclerview-v7:22.2.0'
        compile 'com.android.support:cardview-v7:22.2.0'
        compile 'com.android.support:appcompat-v7:22.2.0'
        compile 'com.android.support:support-v4:22.2.0'
        compile 'com.android.support:design:22.2.0'
        compile 'com.android.support:palette-v7:22.2.0'
        compile 'com.google.android.gms:play-services-maps:8.4.0'
        compile 'com.google.android.gms:play-services-analytics:8.4.0'
        compile 'com.google.android.gms:play-services-appindexing:8.4.0'
        compile 'com.google.android.gms:play-services-auth:8.4.0'
        compile 'com.google.android.gms:play-services-location:8.4.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'ch.acra:acra:4.6.1'
        compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
        compile 'com.wdullaer:materialdatetimepicker:2.0.2'
        compile 'com.getbase:floatingactionbutton:1.10.1'
        compile 'com.github.nirhart:parallaxscroll:1.0'
        compile 'com.facebook.android:facebook-android-sdk:[4,5)'
        compile 'com.parse.bolts:bolts-android:1.4.0'
        compile 'com.parse:parse-android:1.13.0'
    }

然后,突然,它开始说:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:cardview-v7:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified
   > Could not find com.android.support:support-v4:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified
         hamro-doctor-android:app:unspecified > com.android.support:recyclerview-v7:22.2.0
         hamro-doctor-android:app:unspecified > com.android.support:appcompat-v7:22.2.0
         hamro-doctor-android:app:unspecified > com.android.support:design:22.2.0
         hamro-doctor-android:app:unspecified > com.android.support:palette-v7:22.2.0
   > Could not find com.android.support:support-v4:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified > com.astuetz:pagerslidingtabstrip:1.0.1
   > Could not find com.android.support:support-v4:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified > com.wdullaer:materialdatetimepicker:2.0.2
   > Could not find com.android.support:support-v4:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified > com.facebook.android:facebook-android-sdk:4.10.1
   > Could not find com.android.support:cardview-v7:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.2.0/cardview-v7-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified > com.facebook.android:facebook-android-sdk:4.10.1
   > Could not find com.android.support:support-v4:23.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         https://jcenter.bintray.com/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.pom
         file:/home/yubraj/adt-bundle-linux-x86_64-20131030/sdk/extras/google/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.jar
     Required by:
         hamro-doctor-android:app:unspecified > com.google.android.gms:play-services-analytics:8.4.0 > com.google.android.gms:play-services-basement:8.4.0

我不确定是什么改变了,或者是什么导致了这种情况的发生。

共有1个答案

夏意蕴
2023-03-14

我得到了同样的错误,然后我打开了我的android sdk管理器,并注意到一些更新正在等待。一切都很好,现在更新后,我确实需要重新启动我的“Mac”。

 类似资料:
  • 我一直在使用gradle作为Springboot,它过去很好,但gradle的构建突然停止了工作。我不断收到错误,说找不到依赖项 这是分级代码: 我得到的错误是: 无法解析组织。springframework。启动:spring启动依赖项:2.4。1.无法解析io。关键的。Spring云:spring云服务依赖项:2.4。1.无法解析组织。springframework。云:spring云依赖项:

  • 我已经更新了firebase-auth依赖版本,但gradle构建总是失败。它在中运行良好 项目级别分级文件

  • 我正在尝试建立一个gradle项目。 以下是我的项目结构: 这是我的tobris erpgradle.build(1) 这是我的buildSrcgradle.build(2): 我使用hibernate从XML文件生成数据库实体。生成的类位于生成下的src gen文件夹下。 问题是当我构建项目时,src-gen下的类显示此错误 /tobris-erp/build/src-gen/java/com/

  • 我已经在gradle文件中添加了依赖项,但仍然无法识别jar文件的类。 我得到错误-不能解决类在这里 我已经提到了以下几点 Android Studio缺少外部依赖项 Android Studio坚持使用“Gradle:resolve Dependencies'_debugCompile'”或“detachedConfiguration1” 如何添加本地. jar文件依赖build.gradle文

  • 模块(名为“应用程序”)生成.分级: 整体错误: 错误:配置项目“:App”时出现问题。无法解析配置“:app:_debugcompile”的所有依赖项。找不到com.google.android.gms:play-services-measurement:9.0.0.在以下位置进行了搜索:https://jcenter.bintray.com/com/google/android/gms/pla

  • 我有以下目录结构: Android模块依赖于与AndroidProject在根目录中处于同一级别的所有java gradle项目。 在AndroidProject/settings中。gradle我有: 然后在AndroidProject/AndroidModule/build中。gradle我的依赖项设置如下: 当我调用时,这种依赖结构完美地工作和项目构建 在AndroidProject/bui