I had a working project and today when i set with it after almost 2 weeks its showing error in build.gradle file. I might have installed the android studio updates. Below is what i have in gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.shaon.myapp"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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'
})
// RecyclerView
// CardView
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
testCompile 'junit:junit:4.12'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'org.jsoup:jsoup:1.7.3'
compile 'com.android.support:palette-v7:+'
}
and the error i am getting in from Build tab is :
../../Users/xxx/.gradle/caches/transforms-1/files-1.1/appcompat-v7-25.2.0.aar/a15b23bb4246ae6c7bb03ff4cce6bf47/res/values/values.xml
error: resource android:attr/fontStyle not found.
error: resource android:attr/font not found.
error: resource android:attr/fontWeight not found.
error: resource android:attr/fontVariationSettings not found.
error: resource android:attr/ttcIndex not found.
Also in the declaration on the line compile 'com.android.support:appcompat-v7:25.2.0'
- its showing error:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0-alpha1, 26.0.0-alpha1, 25.2.0. Examples include com.android.support:collections:28.0.0-alpha1 and com.android.support:animated-vector-drawable:26.0.0-alpha1 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).
How do i solve this?
Use an actual version rather than a plus on
support:palette-v7:+'
Make sure that version matches the other v7 ones
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.