Back-porting an app to Android 1.5, I fix VerifyError bugs all the time, but here is one that is much less obvious than usual (full log here):
W/dalvikvm( 6978): VFY: invalid reg type 8 on iput instr (need 6)
W/dalvikvm( 6978): VFY: rejecting opcode 0x5c at 0x0004
W/dalvikvm( 6978): VFY: rejected Lcom/ichi2/anki/CardEditor;.access$1776 (Lcom/ichi2/anki/CardEditor;I)Z
W/dalvikvm( 6978): Verifier rejected class Lcom/ichi2/anki/CardEditor;
W/dalvikvm( 6978): Class init failed in newInstance call (Lcom/ichi2/anki/CardEditor;)
D/AndroidRuntime( 6978): Shutting down VM
W/dalvikvm( 6978): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
E/AndroidRuntime( 6978): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 6978): java.lang.VerifyError: com.ichi2.anki.CardEditor
E/AndroidRuntime( 6978): at java.lang.Class.newInstanceImpl(Native Method)
The interesting line seems to be: rejected Lcom/ichi2/anki/CardEditor;.access
The baffling thing is that there is no access
method in class CardEditor nor its parent class Activity, at any level of the public API. The non-API Android source code actually contains ActivityThread.access, but I use exclusively the public API.
This CardEditor
class does not import any compiled libraries (jar or so). The import statements are either "android." or refer Java source files that are in the same project, and thus get recompiled at the same time. If that matters, here is how I always compile: ant clean debug
, fresh Ant file created automatically by the Android SDK.