After successfully importing an eclipse-made Android project into Android Studio, launch the build and report an error such as, but the project can start running normally:
most of the online Most of the solutions are:
Add the following code to the configuration file Proguard-rules.pro of the project project:
-keepattributes Enclosingmethod
But after the attempt is still not able to publish, the last use of this method to solve, after the addition can be published normally
First modify the Gradle configuration file, enable Multidex, and include Multidex support:
Defaultconfig {
multidexenabled true
}
dependencies {compile ' com. android.support:multidex:1.0.1 '}
Then let the app support multiple Dex files. Three optional methods are described in Multidexapplication Javadoc:
1, in the application of Androidmanifest.xml declaration android.support.multidex.MultiDexApplication;
2, if you already have your own application class, let it inherit multidexapplication;
3, if your application class has been inherited from other classes, you do not want/can modify it, then you can rewrite the Attachbasecontext () method:
@Override protected void Attachbasecontext (Context base) { Super. Attachbasecontext (base); Multidex.install (this); }
Finally, it can be run, or packaged, and this problem is said to be in the engineering of the number of methods more than the number of Android 65,536 methods.
Android Studio warning:ignoring innerclasses attribute for an anonymous inner class