错误:任务执行失败':app:transformClassesAndResourcesWithProguardForDebug' [英] Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'

查看:2370
本文介绍了错误:任务执行失败':app:transformClassesAndResourcesWithProguardForDebug'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在我的项目中使用某些librairy。
当我想要bebu我的应用程序时,我收到一个指示,告诉我我的代码超过65k方法。
因此我决定使用Proguard。
但我收到此错误。
我的buile.gradle代码

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'
 }

我收到此错误

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




java.io.IOException:proguard.ParseException:期望类型和名称而不只是' '之前'('在第114行的文件中'C:\ Users \ AMANI \ AndroidStudioProjects \DelyDress \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\ _debug \ aapt_rules.txt'
警告:处理任务java.io.IOException时出现异常:proguard.ParseException:在'('之前'期望类型和名称而不是'
'线114文件的 'C:\Users\AMANI\AndroidStudioProjects\DelyDress\app\build\intermediates\proguard-rules\debug\aapt_rules.txt'
:应用程序:transformClassesAndResourcesWithProguardForDebug FAILED

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 = param。删除它解决了我的问题。

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.

这篇关于错误:任务执行失败':app:transformClassesAndResourcesWithProguardForDebug'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆