Unable to compile my android project

18,378

Solution 1

It happens because the the 21.0.1 for support libraries doesn't exist.

You can use in build.gradle one of these:

dependencies{

  //it requires compileSdkVersion 23
  compile 'com.android.support:appcompat-v7:23.2.0'
  compile 'com.android.support:appcompat-v7:23.1.1'
  compile 'com.android.support:appcompat-v7:23.1.0'
  compile 'com.android.support:appcompat-v7:23.0.1'
  compile 'com.android.support:appcompat-v7:23.0.0'

  //it requires compileSdkVersion 22
  compile 'com.android.support:appcompat-v7:22.2.1'
  compile 'com.android.support:appcompat-v7:22.2.0'
  compile 'com.android.support:appcompat-v7:22.1.1'
  compile 'com.android.support:appcompat-v7:22.1.0'
  compile 'com.android.support:appcompat-v7:22.0.0'

  //it requires compileSdkVersion 21
  compile 'com.android.support:appcompat-v7:21.0.3'
  compile 'com.android.support:appcompat-v7:21.0.2'
  compile 'com.android.support:appcompat-v7:21.0.0'

}

The same consideration is valid also for the com.android.support:recyclerview-v7

Solution 2

I faced similar issue and installed android SDK build tools -v23.0.1 and referred Android setup guide https://facebook.github.io/react-native/docs/android-setup.html#content

but couldn't locate "Android support repository",for latest version of SDK manager- the option is changed to "Local maven repository for support libraries".

enter image description here

Solution 3

I think the buildToolsVersion "23.0.0 rc2" line is causing the problem.

change it to buildToolsVersion "21.0.1"

or try

compileSdkVersion 21
buildToolsVersion "22.0.1"

and

compile 'com.android.support:appcompat-v7:22.2.0'

and yes what sharj has said is also correct, you maybe missing the build tools

Share:
18,378
Sathya Baman
Author by

Sathya Baman

A software engineer with experience in programming software across various platforms. I am a specialist in Mobile technologies, I take pride in coding to consistently high standards. Website sathyabaman.com Git Hub Sathya-Baman Linkedin sathyabaman Play Store sathyabaman Love to code && I live to code.

Updated on June 18, 2022

Comments

  • Sathya Baman
    Sathya Baman almost 2 years

    When i try to compile my android project iam getting the following error.

      Error:A problem occurred configuring project ':app'.
      Could not resolve all dependencies for configuration ':app:_debugCompile'.
      Could not find com.android.support:appcompat-v7:21.0.1.
         Searched in the following locations:
             https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
             https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
             file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
             file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
             file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
             file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
         Required by:
             SriLankaTemples:app:unspecified
       Could not find com.android.support:recyclerview-v7:21.0.1.
         Searched in the following locations:
             https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
             https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
             file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
             file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
             file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
             file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
         Required by:
             SriLankaTemples:app:unspecified
    

    Here is my Gradle file

        apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 19
        buildToolsVersion "23.0.0 rc2"
    
        defaultConfig {
            applicationId "lk.lankahomes.baman.srilankatemples"
            minSdkVersion 16
            targetSdkVersion 21
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:21.0.1'
        compile 'com.android.support:recyclerview-v7:21.0.1'
    }
    

    can some one help me to fix this thank you.

  • Gan Quan
    Gan Quan almost 8 years
    This solved my problem, but as of 7/15/2016 it's been renamed to "Android Support Repository"