I don\'t know how I can describe this issue. I searched a lot, but I didn\'t find any solution.
Also this solution did not help me -keepattributes EnclosingMethod:
You've got 2 problems here.
1) Warning:Ignoring InnerClasses attribute for an anonymous inner class ......
It's just a warning. If your code works properly you can ignore it by disabling Lint in the .gradle
file:
android {
...
lintOptions {
abortOnError false
}
}
2) translation error: attempt to set or access a value of type int using a local variable of type android.support.design.widget.CoordinatorLayout$LayoutParams
This looks like in some place ProGuard optimizes variable allocation, but does it incorrectly.
Try to disable this optimization by adding the line below in your ProGuard file:
-optimizations !code/allocation/variable
Add dex.force.jumbo=true
into your gradle.properties. It works for me.
I resolved a similar issue by updating the compile SDK, target SDK version, and support libraries version.
I've noticed that often the cause for this problem is when proguard-android.txt file is not referenced in the project, as it contains the correct configuration to avoid this issue:
# Preserve some attributes that may be required for reflection.
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod
Make sure to add this file to your project, along with your own ProGuard configuration files, for example:
release {
minifyEnabled true
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
}
The file is contained in the SDK so your gradle build will pick it up automatically, you don't need to copy it to your project.
Try adding
-keepattributes InnerClasses
-dontoptimize
to the ProGuard config. That should fix the problem.
It's probable that incompatible optimizations are applied (that probably causes the last line of the error log).
If you want to allow optimizations, it's necessary to fine tune optimizations config with
-optimizations optimization_filter
option in ProGuard config.
For me what solved the problem was to use a newer version of jar. The clue was:
This class was probably produced by a compiler that did not target the modern .class file format. The recommended solution is to recompile the class from source, using an up-to-date compiler.
So i changed from:
compile 'com.google.inject:guice:4.0'
to:
compile 'com.google.inject:guice:4.2.0'