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

问题描述:

放appium 'Java的客户端' 在Android Studio中不建的apk我做什么,请告诉我使用创建自动化脚本的APK文件Android Studio中

的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

错误文本

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: net/sf/cglib/beans/BeanCopier$BeanCopierKey.class

+0

您能否将错误置于您的问题文本中,imgur经常被阻止,而且人们不喜欢必须输入内容才能为您寻找帮助。 – JeffUK

+0

上面添加了,请检查....错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:net/sf/cglib/beans/BeanCopier $ BeanCopierKey.class –

您可以使用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'