Pregunta

I used the following config in build.gradle to enable proguard

buildTypes{
    qa {
        runProguard true
        proguardFile getDefaultProguardFile('proguard-android.txt')
        versionNameSuffix "_qa"
        signingConfig signingConfigs.debugConfig
    }
}

I get the following error:

Error:Execution failed for task ':Main:proguardQa'. proguard.ParseException: Expecting class member name before '@' in line 441 of file '/mnt/scratch/git/projectname/Main/build/proguard/qa/aapt_rules.txt'

this aapt_rules.txt file is automatically generated.

What's wrong?

¿Fue útil?

Solución 2

Aapt indeed generates this file automatically, but it has a few known issues. Line 441 of your generated file may provide some information. Notably, aapt in some cases has problems with referenced strings instead of raw strings for class names or method names in XML resource files. You should then use raw strings for these cases.

Otros consejos

In my case the problem was in a layout with

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:minHeight="@null"
android:onClick="@null" >

proguard tried to use "null" as a name for a class member

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top