1

The following is that LogCat output for the runtime exception my Android application is displaying, first the wranings generated followed by the stack trace when the application exited:

03-01 12:04:37.663: W/dalvikvm(2285): VFY: unable to resolve exception class 194 (Lcom/google/zxing/WriterException;)
03-01 12:04:37.663: W/dalvikvm(2285): VFY: unable to find exception handler at addr 0x4c
03-01 12:04:37.663: W/dalvikvm(2285): VFY:  rejected Lcom/beslogic/profile/BLProfileBuilder;.saveProfileAsQRCode (Landroid/app/Activity;Lcom/beslogic/profile/BLProfileModel;Ljava/io/FileOutputStream;)Z
03-01 12:04:37.663: W/dalvikvm(2285): VFY:  rejecting opcode 0x0d at 0x004c
03-01 12:04:37.663: W/dalvikvm(2285): VFY:  rejected Lcom/beslogic/profile/BLProfileBuilder;.saveProfileAsQRCode (Landroid/app/Activity;Lcom/beslogic/profile/BLProfileModel;Ljava/io/FileOutputStream;)Z
03-01 12:04:37.663: W/dalvikvm(2285): Verifier rejected class Lcom/beslogic/profile/BLProfileBuilder;





 03-01 12:07:31.633: E/AndroidRuntime(2285): FATAL EXCEPTION: main
    03-01 12:07:31.633: E/AndroidRuntime(2285): java.lang.VerifyError: com.beslogic.profile.BLProfileBuilder
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.urbanagenda.UAMemberActivity.completeTransaction(UAMemberActivity.java:401)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.beslogic.remotpayment.connection.PostJSONTask.sendTransactionComplete(PostJSONTask.java:175)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.beslogic.remotpayment.connection.PostJSONTask.onPostExecute(PostJSONTask.java:162)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.beslogic.remotpayment.connection.PostJSONTask.onPostExecute(PostJSONTask.java:1)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.os.AsyncTask.finish(AsyncTask.java:417)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.os.AsyncTask.access$300(AsyncTask.java:127)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.os.Handler.dispatchMessage(Handler.java:99)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.os.Looper.loop(Looper.java:123)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at java.lang.reflect.Method.invokeNative(Native Method)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at java.lang.reflect.Method.invoke(Method.java:521)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
    03-01 12:07:31.633: E/AndroidRuntime(2285):     at dalvik.system.NativeStart.main(Native Method)

I have a library project where BLProfileBuilder lives. This project references the ZXING android project, which I have marked as a library project also. There is also a reference to the ZXING core library. Everything is properly reference by adding the external .jar files. My main application is targeting Android API level 8 (2.2) while the others are targeting 2.1. Any hints how to go about resolving this. I have followed all the instructions on the ZXING project page, and the Android developer guide for adding library projects and third party jar files.

How would I go about troubleshooting this or tracking down the error?

Mike D
  • 4,788
  • 6
  • 42
  • 94

2 Answers2

2

If you search for VerifyError and Android here in StackOverflow you'll find some good posts that might help you get started like this: Android java.lang.VerifyError? I suspect you will find that as the high (but not accepted) answer suggests, you're using some method in Java that isn't supported for your API level.

Community
  • 1
  • 1
kabuko
  • 35,009
  • 7
  • 75
  • 92
  • 1
    Had a look, but I can't figure out which method. The API level was one of the first things I double checked. I did find a solution but its not elegant, I had to reference (in my main application) the zxing core library (core.jar) containing the declaration for an exception, even though my main application not does use those classes at all, only my library project (BLProfileBuilder). – Mike D Mar 01 '12 at 19:15
  • Ahh... well, there you go. If BLProfileBuilder uses the exception class but doesn't contain it, then it shouldn't be surprising that you have to reference that 3rd party jar with the exception class. – kabuko Mar 01 '12 at 19:17
  • It does contain it, that is the confusing part. To fix an error I made in my last comment, I had to reference the ZXING Android project in my main project as a Library project, even though it does not use it. BLProfileBuuilder has all the references it needs, both the ZXING Android project AND the core library. – Mike D Mar 01 '12 at 19:22
0

Try using a Oracle JVM instead of OpenJDK's ... that solved the mystery issue for me.

Shark
  • 5,787
  • 3
  • 21
  • 46