I am following the 'First App' tutorial found at https://developer.android.com/training/basics/firstapp/index.html. However, on creating a default 'Empty activity' project and trying to build it, I receive the following errors:
- Error:(23, 24) Failed to resolve: com.android.support.test:espresso-core:2.2.2
- Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.+
My (default / autogenerated) build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.myfirstapp"
minSdkVersion 15
targetSdkVersion 26
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.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Although I have looked at several related Stack Overflow questions, I am yet to find a solution that works. I am using a fresh, default install of Android Studio 2.3.3.
You should check if your repository
includes new google maven repo.
Something like:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
See docs for details.
Used compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With