我目前正在使用 JSoup 作为外部 jar,以下代码段在模拟器中引发运行时异常并最终导致应用程序崩溃:
Document doc = Jsoup.connect(“http://www.cnn.com”).get();
06-18 14:00:17.272: I/dalvikvm(424): Could not find method org.jsoup.Jsoup.connect, referenced from method com.pamir.ODeskActivity.getList
06-18 14:00:17.272: W/dalvikvm(424): VFY: unable to resolve static method 25: Lorg/jsoup/Jsoup;.connect (Ljava/lang/String;)Lorg/jsoup/Connection;
06-18 14:00:17.282: D/dalvikvm(424): VFY: replacing opcode 0×71 at 0×0007
06-18 14:00:17.892: D/AndroidRuntime(424): Shutting down VM
06-18 14:00:17.905: W/dalvikvm(424): threadid=1: thread exiting with uncaught exception (group=0×40014760)
06-18 14:00:17.912: E/AndroidRuntime(424): FATAL EXCEPTION: main
06-18 14:00:17.912: E/AndroidRuntime(424): java.lang.NoClassDefFoundError: org.jsoup.Jsoup
06-18 14:00:17.912: E/AndroidRuntime(424): at com.pamir.ODeskActivity.getList(ODeskActivity.java:24)
这是清单:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".ODeskActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
我究竟做错了什么?任何帮助表示赞赏。