Reputation: 11
I have a problem with Gradle
!!
It keeps showing me errors , can some one help me to resolve this problem
Note: It's my first time to install android studio
Upvotes: 1
Views: 321
Reputation: 19351
The problem is you're using
compile 'com.android.support:appcompat-v7:19.+'
which gives you all possibilities of Android 4.4.2 Kitkat API 19 and older.
In your project you're trying to use Material Themes which belongs to newer version, I mean com.android.support:appcompat:$version
, where version > 21.
Material Design was introduced with Android 5.1 Lollipop API 21
I higly reccomend you to change your build.gradle
file to:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:24.2.1"
}
but of course changing appcompat
library to version :
com.android.support:appcompat-v7:23.0.1"
would be enough ;-)
Hope it would help
Upvotes: 0
Reputation: 1084
Try using this:
compile 'com.android.support:appcompat-v7:24.1.0'
Use latest support library and change your target and compile sdk also
compileSdkVersion 24
buildToolsVersion "24.0.1"
targetSdkVersion 24
Upvotes: 3
Reputation: 1948
Try to match all versions:
compileSdkVersion 23 buildToolsVersion '23.0.0' targetSdkVersion 23
Add Following dependencies: compile 'com.android.support:appcompat-v7:23.0.0'
Make sure you use latest version of Sdk: how to update sdk
Upvotes: 0
Reputation: 3873
Please use my project gradle values and also update sdk libraries:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
multiDexEnabled true
applicationId "com.example.student" //change as your package name
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
Upvotes: 0
Reputation: 633
Try it
compile "com.android.support:appcompat-v7:23.0.1"
and you can change targetSdkVersion 23
Upvotes: 0