importing HtmlUnit to Android project

流过昼夜 提交于 2019-12-11 10:47:13

问题


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;

ERROR:

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?


回答1:


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.

Refer This answer



来源:https://stackoverflow.com/questions/36843172/importing-htmlunit-to-android-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!