0
Error:Failed to resolve: com.android.support:appcompat-v7:23.2.0

This is the error I get when I tried to compile my android application. I looked about many questions that have been asked about this issue and tries to update my SDK, reopen Android Studio and chane to: compile (com.android.support:appcompat-v7:+) and nothing works, Android Studio still complains that he can't resolve it. Someone knows why it happens? This is all my Gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'


    lintOptions {
        abortOnError false
    }

    defaultConfig {
        applicationId "com...."
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 35
        versionName "1.5"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'

    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.android.support:cardview-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.google.android.gms:play-services-appindexing:8.4.0'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile project(':library')

    compile 'net.steamcrafted:materialiconlib:1.0.8'
    compile 'com.pes.materialcolorpicker:library:1.0.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'

    compile('de.psdev.licensesdialog:licensesdialog:1.8.0')

    compile 'com.github.paolorotolo:appintro:3.4.0'

    compile 'com.github.deano2390:MaterialShowcaseView:1.0.6'

    compile "com.oneskyapp:screenshot:0.7.4"

    compile('com.mikepenz:materialdrawer:4.6.4@aar') {
        transitive = true
    }
}

My sdk Extras are all installed: enter image description here

Y. Franco
  • 337
  • 1
  • 2
  • 10

4 Answers4

1

Check your SDK Manager. Most of the "normal" support components are contained in the support repository. "Android Support Library" is not enough. This installs the standalone version not the one used by gradle.

pic

Kuffs
  • 35,581
  • 10
  • 79
  • 92
1

Please rename your support library dependencies in the below pattern and check as this may help you .Also instead of hardcoding it picks the latest update .

compile 'com.android.support:appcompat-v7:$supportLibraryVersion' compile 'com.android.support:support-v4:$supportLibraryVersion'

0

Change if you are using buildToolsVersion '23.0.2' then use

 compile 'com.android.support:appcompat-v7:23.1.1'
 compile 'com.android.support:design:23.1.1'
 compile 'com.android.support:support-v4:23.1.1'

And if you want to use "23.2.0" plz update your SDK completely.

Edit Check Check this too

Is your SDK look like this? If yes firstly clean your code and build again.

Android Geek
  • 8,956
  • 2
  • 21
  • 35
  • "Ignoring unknown package filter 'build-tools-23.2.0'Warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter." When I try to do it – Y. Franco Mar 04 '16 at 06:40
  • Thanks for the fast answer, I tried it, and the somehow the error is still the same: "Error:Failed to resolve: com.android.support:appcompat-v7:23.2.0", even that there is no such line in my gradle file. – Y. Franco Mar 04 '16 at 06:44
  • Ok check your SDK Manager and let me know if all the packages has been installed? – Android Geek Mar 04 '16 at 06:45
  • All the packages in apis 23, 22, 21, Tools and Extras are installed and up to date. – Y. Franco Mar 04 '16 at 06:50
  • @Y.Franco Ok Restart your Android Studio and clean your project. Give it a try. – Android Geek Mar 04 '16 at 06:54
  • Did it, still the same. It's weird, even I am removing the line compile 'com.android.support:appcompat-v7:23.2.0' it still complains the same error.. – Y. Franco Mar 04 '16 at 06:58
  • @Y.Franco can you post your LogCat output? – Android Geek Mar 04 '16 at 07:05
  • @Erginus_Android Gradle logs aren't part of the LogCat. The code won't compile. – OneCricketeer Mar 04 '16 at 07:06
  • @Y.Franco Tell me what is your gradle version? classpath 'com.android.tools.build:gradle:1.5.0' – Android Geek Mar 04 '16 at 07:11
  • My gradle version is 2.8, Android plugon version: 1.5.0 classpath 'com.android.tools.build:gradle:1.5.0' – Y. Franco Mar 04 '16 at 07:13
0

As you said your android studio have all update. Then this issue can occur with many reasons...

1..Make sure you have proper internet connectivity when sync, rebuild or run your project. Because you are using many remote dependencies like(compile 'com.android.support:appcompat-v7:23.2.0') and in that case gradle downloads all remote dependencies.

2.. As you are using both local and remote dependencies and If you have any appcompat v7 in libs folder of app in that case this issue can occur because one library version compatibility.

// Remote binary dependency
compile 'com.android.support:appcompat-v7:23.2.0'

// Local binary dependency
compile fileTree(dir: 'libs', include: ['*.jar'])
Vishal Chauhan
  • 932
  • 1
  • 6
  • 11