I am migrating from Eclipse to Android Studio, and now my application crashes, with the Logcat showing different reasons for different phones, but focusing on a very large method I have. For example:
Android 6.0.1 phone:
java.lang.VerifyError: Verifier rejected class due to bad method
Android 2.3.6 phone:
W/dalvikvm: VFY: warning: method is huge (regs=466 insnsSize=25467)
Using Eclipse I did not have problems from Android 2.3.6 onwards (my application only crashed in phones with versions of Android below 2.3.6). Now in Android Studio, my application crashes in all versions of Android.
I have read that the size of the file should not give errors for Android versions 2.3.6 and above. That was true with Eclipse. I am new to Android Studio; maybe there is a compatibility issue easy to solve?
ADVICE: I decided to refactor the method and solved the problem.