Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:25.0.1
Error:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.0
Here is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.jignesh.myapplication"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
}
In android studio, tools->android->sdk manager->sdk tools-> update a android support repository rev 41.
See In your SDK tools which SKD you already Downloaded. And choice one of them like 21.3.4 ... note: must get below of buildToolsVersion and compiler your project.
you can use:
and it would solve the problem but I don't think its the most efficient way because when you do this you'll probably be getting rendering errors or warning on your activity.xml page and you don't want to risk that.
another way to solve this is to go to
tools ==> appearance and behavior ==> system settings ==> android SDK ==> SDK platforms and untick all android versions listed above android 7.0(Nougat).
close android studio and restart your project.
I use android 2.2 and have not upgraded to the latest so this solution might be different and not work on other android studio versions.
I hope this helps.
cheers
Remove all SDK and SDK TOOL from SDK manager and reinstall
I honestly don't understand why this is not automatically catered for when you create a new project... Solution is to add
under allprojects => repositories in project level build.gradle
You have to use maven repository too in your project gradle file -
And sync your project, it will work :-)