Reputation: 357
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:
Upvotes: 0
Views: 1364
Reputation: 29
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'
Upvotes: 1
Reputation: 917
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'])
Upvotes: 0
Reputation: 9225
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.
Is your SDK look like this? If yes firstly clean your code and build again.
Upvotes: 0
Reputation: 35661
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.
Upvotes: 1