I have already installed Android SDK Platform 26, Android SDK Tools 26.0.2
This is my app level build.gradle
file.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 26
...
}
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.0.2'
compile 'com.android.support:support-v4:26.0.2'
testCompile 'junit:junit:4.12'
}
I can't sync the gradle. I am getting these errors:
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.2
Error:(27, 13) Failed to resolve: com.android.support:support-v4:26.0.2
Are the appcompat
and support
library versions are wrong?
How can I solve this issue? Please help.
Thanks in advance.
426. An Android support library that enables the use of the ActionBar and Material Design specific implementations such as Toolbar for older devices down to Android v2.
AppCompatActivity is the new way to go because the ActionBar is not encouraged anymore and you should use Toolbar instead (that's currently the ActionBar replacement). AppCompatActivity inherits from FragmentActivity so if you need to handle Fragments you can (via the Fragment Manager).
There are two things to it
First
This is the page that announces recent releases of the support library, and I don't see 26.0.2 version. The latest is 26.0.0-beta2 and Note that 26.0.0-beta2 is a pre-release version
Second
Make sure you have google's maven repository included in you project's gradle file. Something like :
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
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