在android studio项目中发生了Gradle任务错误

我的项目运行成功。 但是在构build完成之后突然出现以下错误。

谁能告诉我这里发生了什么? 我不知道这个错误。 我应该如何解决它?

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.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar Required by: FinderMaterial:app:unspecified > Could not find com.android.support:support-v4:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.facebook.android:facebook-android-sdk:4.11.0 > Could not find com.android.support:cardview-v7:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom https://jcenter.bintray.com/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/cardview-v7/23.2.1/cardview-v7-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.facebook.android:facebook-android-sdk:4.11.0 > Could not find com.android.support:customtabs:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/customtabs/23.2.1/customtabs-23.2.1.pom https://jcenter.bintray.com/com/android/support/customtabs/23.2.1/customtabs-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/customtabs/23.2.1/customtabs-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/customtabs/23.2.1/customtabs-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/customtabs/23.2.1/customtabs-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/customtabs/23.2.1/customtabs-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/customtabs/23.2.1/customtabs-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/customtabs/23.2.1/customtabs-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.facebook.android:facebook-android-sdk:4.11.0 > Could not find com.android.support:support-v4:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.android.support:recyclerview-v7:23.2.0 FinderMaterial:app:unspecified > com.android.support:design:23.2.0 FinderMaterial:app:unspecified > com.android.support:appcompat-v7:23.2.0 FinderMaterial:app:unspecified > com.android.support:appcompat-v7:23.2.0 > com.android.support:support-vector-drawable:23.2.0 > Could not find com.android.support:support-v4:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.flipboard:bottomsheet-core:1.5.0 FinderMaterial:app:unspecified > com.flipboard:bottomsheet-commons:1.5.0 FinderMaterial:app:unspecified > com.github.citux:datetimepicker:0.2.0 > com.android.support:support-v13:23.1.1 > Could not find com.android.support:support-v4:23.2.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://jcenter.bintray.com/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom https://repo1.maven.org/maven2/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/android/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.pom file:/opt/android-sdk-linux/extras/google/m2repository/com/android/support/support-v4/23.2.1/support-v4-23.2.1.jar Required by: FinderMaterial:app:unspecified > com.google.android.gms:play-services:8.4.0 > com.google.android.gms:play-services-basement:8.4.0 

提前致谢。

  • 在Gradle中为Android中的库项目构建变体
  • Android Crashlytics ndk; NdkOut和NdkLibsOut在build.gradle中的值
  • Android Studio 3.0:在Gradle文件中找不到buildToolsVersion
  • Android Studio更新 - 错误:无法使用Gradle分发运行构build操作
  • Android Studio - 无法生成项目 - GradleConnectionException
  • 从“app-debug.apk”更改生成的apk名称
  • 在Android Studio中更新buildToolsVersion '23 .0.1'后出现内存不足问题
  • 在AndroidManifest.xml中为一个buildvariantreplacestring不适用于Gradle Android插件版本> 0.5.4
  • 你应该更新你的Android存储库做到这一点:

    1. 打开SDKpipe理器
    2. Android支持信息库
    3. 安装软件包

    在这里输入图像说明

    在Android Studio 2.0中,您可以在以下位置find它:

    工具 – > Android的-SDKpipe理器菜单选项。

    一旦对话框打开,打开Apearance和行为>系统设置> Android SDK ,然后select第二个选项卡, SDK工具

    如果你想从命令行解决它(也许像我的情况下自动生成服务器):

    echo y | android update sdk --no-ui --filter extra-android-m2repository --force --all