我使用 JSOUP 库在 android 应用程序中解析 html。我创建了一个 lib 文件夹,在其中放置了 .jar 文件,然后按照本教程中的说明添加到 Buildpath 。当我编写包含导入库中的对象和方法的代码时,我在 Eclipse 中没有收到任何抱怨,但是当我运行它时,我得到了这个错误。
11-25 01:05:16.108: E/AndroidRuntime(785): FATAL EXCEPTION: main
11-25 01:05:16.108: E/AndroidRuntime(785): java.lang.NoClassDefFoundError: org.jsoup.Jsoup
11-25 01:05:16.108: E/AndroidRuntime(785): at com.example.seminarska.Prevozi.onCreate(Prevozi.java:76)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.Activity.performCreate(Activity.java:5008)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.os.Handler.dispatchMessage(Handler.java:99)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.os.Looper.loop(Looper.java:137)
11-25 01:05:16.108: E/AndroidRuntime(785): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-25 01:05:16.108: E/AndroidRuntime(785): at java.lang.reflect.Method.invokeNative(Native Method)
11-25 01:05:16.108: E/AndroidRuntime(785): at java.lang.reflect.Method.invoke(Method.java:511)
11-25 01:05:16.108: E/AndroidRuntime(785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-25 01:05:16.108: E/AndroidRuntime(785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-25 01:05:16.108: E/AndroidRuntime(785): at dalvik.system.NativeStart.main(Native Method)