Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle task error occurred in android studio project

My project was running successfully. But suddenly I am getting the following error after the build finished.

Can anyone tell me what is going on here? I have no idea about this error. How should I fix it?

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

Thanks in advance.

like image 484
anuradha Avatar asked Apr 13 '16 10:04

anuradha


2 Answers

You should update your Android Repository do to it:

  1. Open SDK Manager
  2. Android Support Repository
  3. Install packages

enter image description here

In Android Studio 2.0, you can find this in:

Tools -> Android -SDK Manager menu option.

Once the dialog opens, open Apearance and Behavior > System settings > Android SDK, and then select the second tab, SDK Tools.

like image 155
Alexander Avatar answered Oct 14 '22 22:10

Alexander


If you want to fix it from command line (maybe for automated build server like my case):

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

like image 32
Jianxin Gao Avatar answered Oct 14 '22 21:10

Jianxin Gao