We have a fairly large android project all written in kotlin.
When moving from Kotlin 0.6.1315 to 0.6.1411, we get an error when trying to install the generated apk:
12-02 08:46:52.668 2765-2765/? E/dalvikvm﹕ Out-of-order method_idx: 0x1ba9 then 0x1ba9
12-02 08:46:52.668 2765-2765/? E/dalvikvm﹕ Trouble with item 652 @ offset 0x166c34
12-02 08:46:52.668 2765-2765/? E/dalvikvm﹕ Swap of section type 2006 failed
12-02 08:46:52.668 2765-2765/? E/dalvikvm﹕ ERROR: Byte swap + verify failed
12-02 08:46:52.678 2765-2765/? E/dalvikvm﹕ Optimization failed
It looks like the byte code generated by this new version of Kotlin has changed and includes
something that dex doesn’t like.
We’ve had this error before, but it was introduced by changes in our code so we could track it down
to a specific commit and isolate the troubling code. Usually it was because of having a property called
prop when there was already an inherit method called getProp() or setProp() somewhere in the class
This time however, the error is introduced by a change in kotlin version, so we can’t track what’s the
specific code that is causing the problem. Our project is just too large.
I will try to track to narrow the search to the specific version of kotlin where the version starts.