After upgrading my gradle, I got this errors which I don’t know how to fix.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-small-v4\values-small-v4.xml:6: error: invalid resource type 'attr' for parent of style.
Command: C:\Users\NEW03\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\fbd6ed1dfcb88e47cef4efaddf896fef\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\build\intermediates\res\merged\debug \
C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-small-v4\values-small-v4.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
Output: C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\src\main\res\values-small\style.xml:4:5-7:13: AAPT: error: invalid resource type 'attr' for parent of style.
Command: C:\Users\NEW03\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\fbd6ed1dfcb88e47cef4efaddf896fef\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\build\intermediates\res\merged\debug \
C:\Users\NEW03\Documents\AndroidProjects\cssimple\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-small-v4\values-small-v4.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
This is my project level build.gradle.
/ / Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
allprojects {
repositories {
jcenter()
google()
maven { url 'https://maven.google.com/' }
}
}
This is my gradle-wrapper.properties.
#Thu Nov 15 12:08:09 SGT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
This is my app level build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.csipsimple"
minSdkVersion 14
targetSdkVersion 23
}
useLibrary 'org.apache.http.legacy'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.1.0'
compile project(':sherlok')
configurations.compile.exclude module: 'support-v4'
}
The app contains a project app module named sherlok.
After making some changes, now I’m getting this errors.
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"background\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-26.1.0.aar\\508a22a81bc4139c79d92f3f1428ae0c\\res\\values\\values.xml",
"position":{"startLine":86,"startColumn":4,"startOffset":6582,"endColumn":103,"endOffset":6681}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\Documents\\AndroidProjects\\cssimple_bak2\\sherlok\\build\\intermediates\\packaged_res\\debug\\values\\values.xml",
"position":{"startLine":2,"startColumn":4,"startOffset":105,"endColumn":54,"endOffset":155}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"navigationMode\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\Documents\\AndroidProjects\\cssimple_bak2\\sherlok\\build\\intermediates\\packaged_res\\debug\\values\\values.xml",
"position":{"startLine":78,"startColumn":4,"startOffset":4681,"endLine":80,"endColumn":24,"endOffset":4799}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-26.1.0.aar\\508a22a81bc4139c79d92f3f1428ae0c\\res\\values\\values.xml",
"position":{"startLine":86,"startColumn":4,"startOffset":6582,"endColumn":103,"endOffset":6681}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"displayOptions\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\Documents\\AndroidProjects\\cssimple_bak2\\sherlok\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":
{"startLine":78,"startColumn":4,"startOffset":4681,"endLine":80,"endColumn":24,"endOffset":4799}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-26.1.0.aar\\508a22a81bc4139c79d92f3f1428ae0c\\res\\values\\values.xml",
"position":{"startLine":86,"startColumn":4,"startOffset":6582,"endColumn":103,"endOffset":6681}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"itemBackground\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\Documents\\AndroidProjects\\cssimple_bak2\\sherlok\\build\\intermediates\\packaged_res\\debug\\values\\values.xml",
"position":{"startLine":216,"startColumn":4,"startOffset":11002,"endLine":233,"endColumn":24,"endOffset":12031}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\design-26.0.0-beta2.aar\\a4d391f9e97b934910e6f25234ed4504\\res\\values\\values.xml",
"position":{"startLine":159,"startColumn":4,"startOffset":8147,"endColumn":462,"endOffset":8605}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"actionBarSize\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\design-26.0.0-beta2.aar\\a4d391f9e97b934910e6f25234ed4504\\res\\values\\values.xml",
"position":{"startLine":162,"startColumn":4,"startOffset":8872,"endColumn":174,"endOffset":9042}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\design-26.0.0-beta2.aar\\a4d391f9e97b934910e6f25234ed4504\\res\\values\\values.xml",
"position":{"startLine":29,"startColumn":4,"startOffset":1659,"endColumn":198,"endOffset":1853}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"windowMinWidthMajor\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\design-26.0.0-beta2.aar\\a4d391f9e97b934910e6f25234ed4504\\res\\values\\values.xml",
"position":{"startLine":162,"startColumn":4,"startOffset":8872,"endColumn":174,"endOffset":9042}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Original attribute defined here.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-26.1.0.aar\\508a22a81bc4139c79d92f3f1428ae0c\\res\\values\\values.xml",
"position":{"startLine":125,"startColumn":4,"startOffset":9652,"endLine":127,"endColumn":5296,"endOffset":16283}}],"original":"","tool":"AAPT"}
[org.gradle.api.Project] AGPBI: {"kind":"error","text":"Attribute \"windowMinWidthMinor\" already defined with incompatible format.","sources":[
{"file":
"C:\\Users\\NEW03\\.gradle\\caches\\transforms-1\\files-1.1\\design-26.0.0-beta2.aar\\a4d391f9e97b934910e6f25234ed4504\\res\\values\\values.xml",
"position":{"startLine":162,"startColumn":4,"startOffset":8872,"endColumn":174,"endOffset":9042}}],"original":"","tool":"AAPT"}