I recently switched to android studio for development. I had created project with minsdk,targetsdk and compile with sdk as Google Api Level 8.
The project compilation fails due to following code in build.gradle file.
dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}
Can anyone tell why this is hapenning?
My whole build.gradle is posted below.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 8
buildToolsVersion "18.1.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 8
}
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}
Below is the screenshot
You can't compile against any API below 11 and use the AppCompat library. It references the Holo style and the compiler will have no way to resolve those symbols if you're building against an old version.
Get rid of the problem by building against API level 18. This won't break the app for older devices, but you will need to heed the lint API warnings to ensure compatibility. You may have to re-sync the IDE with the gradle files by clicking the gradle icon on the menu bar.
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