Reputation: 935
My intention is to read a raw resource and convert it to Java code using JSON. The class and external libraries that do this are stored in a different project. When I run my app I get this error in the log cat:
06-08 13:51:34.680: WARN/dalvikvm(563): Unable to resolve superclass of
Lnet/sf/json/JSONException; (297)
06-08 13:51:34.680: WARN/dalvikvm(563): Link of class 'Lnet/sf/json/JSONException;' failed
06-08 13:51:34.690: WARN/dalvikvm(563): VFY: unable to resolve exception class 186 (Lnet/sf/json/JSONException;)
06-08 13:51:34.690: WARN/dalvikvm(563): VFY: unable to find exception handler at addr 0x2e
06-08 13:51:34.690: WARN/dalvikvm(563): VFY: rejected Lnet/sf/json/JSONSerializer;.toJSON (Ljava/lang/Object;Lnet/sf/json/JsonConfig;)Lnet/sf/json/JSON;
06-08 13:51:34.700: WARN/dalvikvm(563): VFY: rejecting opcode 0x0d at 0x002e
06-08 13:51:34.700: WARN/dalvikvm(563): VFY: rejected Lnet/sf/json/JSONSerializer;.toJSON (Ljava/lang/Object;Lnet/sf/json/JsonConfig;)Lnet/sf/json/JSON;
06-08 13:51:34.700: WARN/dalvikvm(563): Verifier rejected class Lnet/sf/json/JSONSerializer;
06-08 13:51:34.710: DEBUG/AndroidRuntime(563): Shutting down VM
06-08 13:51:34.710: WARN/dalvikvm(563): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): FATAL EXCEPTION: main
06-08 13:51:34.730: ERROR/AndroidRuntime(563): java.lang.VerifyError: net.sf.json.JSONSerializer
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at fliphouse.JSONUtils.setup(JSONUtils.java:67)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at ie.fliphouse.luas.LuasUtils.readJSON(LuasUtils.java:130)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at ie.fliphouse.luas.ZoneList.onCreate(ZoneList.java:51)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.os.Handler.dispatchMessage(Handler.java:99)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.os.Looper.loop(Looper.java:123)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at java.lang.reflect.Method.invokeNative(Native Method)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at java.lang.reflect.Method.invoke(Method.java:521)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-08 13:51:34.730: ERROR/AndroidRuntime(563): at dalvik.system.NativeStart.main(Native Method)
06-08 13:51:34.740: WARN/ActivityManager(59): Force finishing activity ie.fliphouse.luas/.ZoneList
I can tell that the error is arising from the creation of a JSONArray. I have come across this error already on stackoverflow but there was no clear way of how resolve this. Can anyone recommend to me a way to solve this problem. Help would be greatly appreciated.
Upvotes: 0
Views: 2328
Reputation: 5572
You are adding the net.sf.json library that seems to have a unresolved dependency. Try to use the Android SDK JSON implementaton instead.
Upvotes: 3