0
我的意圖是讀取原始資源並使用JSON將其轉換爲Java代碼。這樣做的類和外部庫存儲在不同的項目中。當我運行我的應用程序我得到這個錯誤日誌貓:Android運行時驗證錯誤
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
我可以告訴大家,錯誤是從創立JSONArray的產生。我在stackoverflow上遇到過這個錯誤,但沒有明確的解決方法。任何人都可以推薦給我一種解決這個問題的方法。幫助將不勝感激。
這看起來很有希望!我不相信我沒有使用過這個。如果解決這個問題,我會接受答案,謝謝。 – Hugs 2011-06-08 14:48:06