Android java.lang.verifyerror for private methods with annotated parameters

private void bar(@Some String a) {…}

The contents of the. Class file become:

void bar(@Some String a) {…}

However, the changed method is still called by the invokespecial JVM instruction, which is only used for private method calls (and for some other non method things), but surprisingly, it is also applicable to "package private" methods on the sun / Oracle JVM. During Android, the. Class = >. DEX conversion, the invokespecial JVM instruction is converted to a direct call to the Dalvik instruction, This instruction can only call private methods and constructors. Because the bar() method has become a visible method in the package, invoke direct cannot find it and raises nosuchmethoderror

The solution is to use eclipse 3.6 or javac compiler (via build. XML ant script)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>