I've gone through the tutorial here and everything works except for my build.gradle. Everything in the 'android' section is is underlined and displays a "Cannot resolve symbol" error message. This is in Android Studio 0.3.1. I've even tried re-installing Android Studio and it still doesn't work.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 18
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
}
I've had it recently with Android Studio 1.3. The only working solution was to remove the .gradle and .idea folders and re-import it in Android Studio.
Seems like you've got version mismatch and Android Studio or Gradle fails to resolve dependencies.
First update Android SDK - update to latests versions, be sure to get SDK platforms v18 & v19.
Then decide which version you're targeting - v18 or v19. If v18, then android
section of build config should look like
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 18
}
}
and if targeting v19:
android {
compileSdkVersion 19
buildToolsVersion "19"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
}
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