[英]Gradle build error after adding appium dependency
I wish to use appium for automation testing (I'm using Android Studio for dev). 我希望使用appium进行自动化测试(我将Android Studio用于开发人员)。
I added a gradle dependency for appium. 我为appium添加了gradle依赖。
However, I am unable to run the app due to following warnings and non zero exit errors. 但是,由于出现以下警告和非零退出错误,我无法运行该应用程序。
Warning:Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
And error as: 错误为:
> Error:Execution failed for task ':app:preDexDebug'.
> java.lang.IllegalArgumentException: Source
> D:\Learning\GDLearning\app\build\intermediates\pre-dexed\debug\websocket-client-9.2.11.v20150529-344b13c53e6f4871f43101e675dc9239cd9ab46b.jar
> and destination
> D:\Learning\GDLearning\app\build\intermediates\pre-dexed\debug\websocket-client-9.2.11.v20150529-344b13c53e6f4871f43101e675dc9239cd9ab46b.jar
> must be different
My build.gradle file is: 我的build.gradle文件是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.gdlearning"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions{
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.google.api-client:google-api-client-android:1.20.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-tasks:v1-rev41-1.20.0') {
exclude group: 'org.apache.httpcomponents'
}
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'io.appium:java-client:3.2.0'
}
Any suggestion/ help would be great! 任何建议/帮助都会很棒!
I explored on SO , tried a few things but it didnt worked. 我在SO上进行了探索,尝试了一些方法,但是没有成功。
You don't need to push appium dependencies to your app Build.gradle files. 您无需将appium依赖项推送到您的应用程序Build.gradle文件。 All you need to do is follow the instructions at official page.
您只需要按照官方页面上的说明进行操作即可。
http://appium.io/slate/en/master/?ruby#quick-start http://appium.io/slate/en/master/?ruby#quick-start
Maybe you should: 也许您应该:
1) Download Appium
2) Setting Evironment variables (ANDROID_HOME, JAVA_HOME, ..)
3) Play with the Appium
4) Write some test code
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.