我目前使用JSoup外部罐子,下面的代码片段抛出运行时异常的模拟器,并最终应用程序崩溃:
I’m currently using JSoup as external jar and the following snippet throws runtime exception in emulator and eventually app crashes:
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)
下面的清单:
Here is the manifest:
<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>
我是什么做错了吗?任何帮助是AP preciated。
What am I doing wrong? Any help is appreciated.
要扩展什么forgivengod说。
To extend what forgivengod said.
也。
右键单击项目 点击Android的工具 点击修复项目属性和
点击项目 清洁