使用Android Studio创建自动化脚本的APK文件

时间:2017-05-25 11:27:34

标签: android-studio appium

放入appium' java-client' android studio中的依赖关系没有构建.apk我做的请告诉我

build.gradle(app)

apply plugin: 'com.android.application'
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    dexOptions {
        incremental true
        jumboMode = true
        // preDexLibraries = false
    }
    defaultConfig {
        applicationId "com.example.ignatiuz.photoboothapplication"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
    }
}
repositories {
    jcenter()
    mavenCentral()
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'io.appium:java-client:3.4.0'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.3.1'
    compile 'commons-logging:commons-logging:1.2'
    // compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
    compile 'org.apache.httpcomponents:httpcore:4.4.6'
    testCompile 'junit:junit:4.12'
    compile files('libs/commons-logging-1.2.jar')
    compile files('libs/httpclient-4.5.3.jar')
    compile files('libs/httpcore-4.4.6.jar')
}

and my jar detail

and my error

错误文字

  

错误:任务':app:transformClassesWithJarMergingForDebug'执行失败。   com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:net / sf / cglib / beans / BeanCopier $ BeanCopierKey.class

1 个答案:

答案 0 :(得分:0)

您可以使用gradle导入所需的所有依赖项,而不是在/libs文件夹中添加它们

这些是我在build.gradle中用于连接和运行Appium测试的依赖项。

compile 'junit:junit:4.12'
compile 'io.appium:java-client:4.1.2'
compile 'com.googlecode.json-simple:json-simple:1.1.1'
compile 'org.apache.httpcomponents:httpclient:4.5.1'
compile 'commons-lang:commons-lang:2.6'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.http-client:google-http-client:1.21.0'
compile 'com.testdroid:testdroid-api:2.9'
compile 'com.google.http-client:google-http-client-jackson2:1.21.0'