将HtmlUnit导入Android项目 [英] importing HtmlUnit to Android project
本文介绍了将HtmlUnit导入Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从htmlunit sourceforge页面下载了htmlunit-2.xx-OSGi.jar。将罐子移到我的/ lib文件夹中,然后在导入这些文件时出现错误。
I downloaded the htmlunit-2.xx-OSGi.jar from htmlunit sourceforge page. Moved that jar into my /lib folder and when I import these I get error.
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
错误:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 1
我在做什么错或如何使用该库?
What am I doing wrong or how can I use this library?
推荐答案
HtmlUnit
不适用于android,因为存在JVM和DVM。您也可以尝试使用 Selenium
,它与 HtmlUnit
的工作方式非常相似,请参考用于硒。
HtmlUnit
doesn't work with android, because of JVM and DVM. You can also try using Selenium
, which is very similar in working to HtmlUnit
, reference for selenium.
引用此答案
这篇关于将HtmlUnit导入Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文