The problems probably related with outdated project template in the Android Studio. You can solve the problems by following the description below.
The first problem:
Error:(23, 24) Failed to resolve:
com.android.support.test.espresso:espresso-core:2.0 Error:(26, 13)
Failed to resolve: com.android.support:appcompat-v7:26.+
is related with support library 26 with google maven. Quoting my answer from https://stackoverflow.com/a/45876864/4758255:
Please be noted that to use support library starting from revision 25.4.0, we need to add google maven. As in the release note says:
Important: The support libraries are now available through Google's
Maven repository. You do not need to download the support repository
from the SDK Manager. For more information, see Support Library Setup.
Read more at Support Library Setup.
Play services and Firebase dependencies since version 11.2.0 are also need google maven. Read Some Updates to Apps Using Google Play services and Google APIs Android August 2017 - version 11.2.0 Release note.
So you need to add the google maven to your root build.gradle like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For Gradle build tools plugin version 3.0.0, you can use google()
repository (more at Migrate to Android Plugin for Gradle 3.0.0):
allprojects {
repositories {
jcenter()
google()
}
}
The second problem:
Error:The SDK Build Tools revision (23.0.2) is too low for project
':app'. Minimum required is 25.0.0
means that you need to use minimum build tools version 25. To solve it, first check your root build.gradle
. It should be contain something like:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
Second, check your App build.gradle
. It should be contain minimum buildToolsVersion 25:
android {
compileSdkVersion 25
buildToolsVersion "25.0.3" // here the builToolsVersion.
defaultConfig {
applicationId "com.example.project"
minSdkVersion 9
targetSdkVersion 25
...
}
..
}