I must use certain librairy in my project. When I want bebu my application I receive an indication which says to me that my code exceeds 65k method. Thus I decided to use Proguard. But I receive this error. my code of 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 receive this error
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
java.io.IOException: proguard.ParseException: Expecting type and name instead of just '' before '(' in line 114 of file 'C:\Users\AMANI\AndroidStudioProjects\DelyDress\app\build\intermediates\proguard-rules\debug\aapt_rules.txt' Warning:Exception while processing task java.io.IOException: proguard.ParseException: Expecting type and name instead of just '' before '(' in line 114 of file 'C:\Users\AMANI\AndroidStudioProjects\DelyDress\app\build\intermediates\proguard-rules\debug\aapt_rules.txt' :app:transformClassesAndResourcesWithProguardForDebug FAILED
In my case it was line in aapt_rules.txt
with -keepclassmembers
that include my layout file. And after check this layout i'm found empty android:onClick=""
param. Removing this solve my problem.
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