在安卓项目中用HTMLunit写爬虫,报错入下,请大家帮帮忙,谢谢

05-16 13:49:12.365: E/AndroidRuntime(678): FATAL EXCEPTION: main
05-16 13:49:12.365: E/AndroidRuntime(678): java.lang.NoClassDefFoundError: com.gargoylesoftware.htmlunit.DefaultCssErrorHandler
05-16 13:49:12.365: E/AndroidRuntime(678): at com.gargoylesoftware.htmlunit.WebClient.(WebClient.java:154)
05-16 13:49:12.365: E/AndroidRuntime(678): at com.gargoylesoftware.htmlunit.WebClient.(WebClient.java:176)
05-16 13:49:12.365: E/AndroidRuntime(678): at com.hyt.data.HtmlText.gethtml(HtmlText.java:28)
05-16 13:49:12.365: E/AndroidRuntime(678): at com.hyt.android.LoginActivity$2.onClick(LoginActivity.java:51)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.view.View.performClick(View.java:3480)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.view.View$PerformClick.run(View.java:13983)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.os.Handler.handleCallback(Handler.java:605)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.os.Handler.dispatchMessage(Handler.java:92)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.os.Looper.loop(Looper.java:137)
05-16 13:49:12.365: E/AndroidRuntime(678): at android.app.ActivityThread.main(ActivityThread.java:4340)
05-16 13:49:12.365: E/AndroidRuntime(678): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 13:49:12.365: E/AndroidRuntime(678): at java.lang.reflect.Method.invoke(Method.java:511)
05-16 13:49:12.365: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-16 13:49:12.365: E/AndroidRuntime(678): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-16 13:49:12.365: E/AndroidRuntime(678): at dalvik.system.NativeStart.main(Native Method)

这个爬虫单独拿出来是可以运行的,当放到安卓项目中就报错了

1个回答

NoClassDefFoundError
看看是不是缺少jar包。

hyt941026
hyt_ao jar包没缺少,全部导入了
接近 4 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问