如何将selenium添加到android项目中

如何将selenium添加到android项目中,android,selenium,Android,Selenium,嗨,我正在尝试将selenium添加到我的android studio应用程序中,但我一直遇到错误 Caused by: java.lang.VerifyError: org.openqa.selenium.htmlunit.HtmlUnitDriver 我已将selenium添加到project structor中,并且我的成绩相关性为 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compi

嗨,我正在尝试将selenium添加到我的android studio应用程序中,但我一直遇到错误

Caused by: java.lang.VerifyError: org.openqa.selenium.htmlunit.HtmlUnitDriver
我已将selenium添加到project structor中,并且我的成绩相关性为

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/selenium-java-2.47.1-srcs.jar')
    compile files('libs/selenium-java-2.47.1.jar')
    compile files('libs/htmlunit-2.17.jar')
    compile files('libs/htmlunit-core-js-2.17.jar')
}
我尝试从selenium lib文件夹添加所有JAR,但这会导致gradle构建时间约为10分钟,然后崩溃。任何人对如何添加selenium有任何想法吗?我使用netbeans,您可以创建一个库并转储一个JAR文件夹,所以我可能只是在做一些非常愚蠢的事情

当添加所有依赖项时,这就是我得到的错误

信息:渐变任务[:app:assembleDebug]

:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:collectDebugMultiDexComponents
:app:packageAllDebugClassesForMultiDex
:app:shrinkDebugMultiDexComponents
:app:createDebugMainDexClassList FAILED
Error:Execution failed for task ':app:createDebugMainDexClassList'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 21.207 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

a!multiDex的最小sdk版本必须大于14,因此在gradle版本中

minSdkVersion 14

我尝试添加//启用多索引支持。multiDexEnabled对build.gradle文件为true,但仍然出现错误