
This is my build.gradle (Module:app) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId "com.doctor.ciao"
minSdkVersion 19
targetSdkVersion 26
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:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.felipecsl:gifimageview:2.1.0'
compile 'com.github.devlight.pulseview:library:1.0.2'
compile 'commons-io:commons-io:2.4'
compile 'com.github.lguipeng:BubbleView:1.0.1'
}
I am getting two errors:
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT error
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT error
I have already added "android.enableAapt2=false" to gradle.properties file but still the error persists. Please help me with this issue. Thank you
My issue was that I had an invalid png file - I had a .jpg file that was accidentally renamed with the .png extension
To find the offending image file I ran this command in my app directory:
find . -type f -name "*.png" | xargs -L 1 -I{} file -I {} | grep -v 'image/png; charset=binary$'
Renaming the image file to a .jpg extension solved the problem and I could build again.
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