Strange java.lang.VerifyError - VFY: 'this' arg 'Ljava/lang/String;' not instance of '(my-class-name)

1.7k views Asked by At

I ran into a java.lang.VerifyError working on an Android application.

I Googled and came across various verify errors but could not find a solid reason for this to happen.

This is the stack trace.

I am using Android SDK Tools 22.3 and the application is running on Android 2.2

W/dalvikvm( 2327): VFY: 'this' arg 'Ljava/lang/String;' not instance of 'Lcom/mypackage/BPM/DATA_Manager_BPM;'
W/dalvikvm( 2327): VFY:  rejecting opcode 0x74 at 0x085d
W/dalvikvm( 2327): VFY:  rejected Lcom/mypackage/DEALER/DEALER_FailedOperationManager$TransactionAsyncTask;.doInBackground ([Ljava/lang/Object;)Ljava/lang/Integer;
W/dalvikvm( 2327): Verifier rejected class Lcom/mypackage/DEALER/DEALER_FailedOperationManager$TransactionAsyncTask;
D/AndroidRuntime( 2327): Shutting down VM
W/dalvikvm( 2327): threadid=1: thread exiting with uncaught exception (group=0x4001d7e8)

Does anyone know what "rejecting opcode 0x74" means of what this "not instance of" error means? Or any clue as to where to look ?

UPDATE

The signature of the TransactionAsyncTask is as follows.

class TransactionAsyncTask extends AsyncTask<Object, Void, Integer>

and I invoke it simply using new TransactionAsyncTask().execute();

The signature of doInBackground is

protected Integer doInBackground(Object... params)

1

There are 1 answers

3
laalto On BEST ANSWER

In doInBackground(), there's a virtual method invocation (opcode 0x74, invoke-virtual with registers) called with a String as this pointer where com.mypackage.BPM.DATA_Manager_BPM is expected.

There are other posts that suggest there might be a ProGuard bug involved.