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

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

我必须在我的项目中使用某些库。 当我想要 bebu 我的应用程序时,我收到一个指示,告诉我我的代码超过 65k 方法。 因此我决定使用 Proguard。 但是我收到这个错误。 我的代码 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'
 }

我收到这个错误

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

在我的例子中,aapt_rules.txt-keepclassmembers 中的行包含我的布局文件。检查此布局后,我发现 android:onClick="" 参数为空。删除它解决了我的问题。