Error generating APK in Android Studio

1

Trying to generate the APK generates the following error:

Warning:Exception while processing task java.io.IOException: proguard.ParseException: Expecting java type before 'com.jakewharton:butterknife.**' in line 1 of file 'C:\Users\unicorn\Documents\Proyectos\Domix\app\proguard-rules.pro'
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

In the file proguard-rules.pro I have already put the external libraries, for example:

-dontwarn com.jakewharton: butterknife. **

And in the build.gradle I have the following:

Does anyone know how I can solve this?

Thanks in advance

    
asked by Didier 27.03.2017 в 20:31
source

1 answer

1

If you are going to use the option -dontwarn I advise you to check what your objective is:

  

-dontwarn Specifies not to warn about unresolved references and   other major problems at all.

If you are not using Butterknife, simply delete it from your project, if you are using it, use this configuration:

# My Butterknife Configuration
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }

-keepclasseswithmembernames class * {
    @butterknife.* <fields>;
}

-keepclasseswithmembernames class * {
    @butterknife.* <methods>;
}
    
answered by 27.03.2017 в 21:57