Error: execution completed for task ': app: transformClassesAndResourcesWithProguardForDebug'

I have to use specific librairy in my project. When I want to bebu my application, I get an instruction that tells me that my code is over 65k. So I decided to use Proguard. But I get this error. my code is buile.gradle

apply plugin: 'com.android.application' apply plugin: 'realm-android' android { compileSdkVersion 24 buildToolsVersion "24.0.0" defaultConfig { applicationId "transplusafrica.delydress" minSdkVersion 19 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.android.support:design:24.0.0' compile 'com.squareup:otto:1.3.8' compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.google.code.gson:gson:2.2.4' compile 'com.google.android.gms:play-services-maps:9.2.0' compile 'com.google.android.gms:play-services-gcm:9.2.0' compile 'com.google.android.gms:play-services-location:9.2.0' } 

I get this error

 Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'. 

java.io.IOException: proguard.ParseException: waiting for type and name instead of " " to '(' on line 114 of the file 'C: \ Users \ AMANI \ AndroidStudioProjects \ DelyDress \ app \ build \ intermediate \ Proguard rules \ Debug \ aapt_rules .txt "Warning: exception during processing java.io.IOException: proguard.ParseException: waiting for type and name instead of" "to '(' on line 114 of the file 'C: \ Users \ AMANI \ AndroidStudioProjects \ DelyDress \ application \ assembly \ intermediate \ Proguard rules \ Debug \ aapt_rules.txt ": app: transformClassesAndResourcesWithProguardForDebug FAILED

+5
source share
1 answer

In my case, it was a line in aapt_rules.txt with -keepclassmembers , which includes my layout file. And after checking this layout I found empty android:onClick="" param. Removing this solution to the problem.

+7
source

All Articles