Android上的Gebish

时间:2016-03-18 16:06:36

标签: android gradle geb

我目前正在尝试将gebish添加到我的项目中。我在build.gradle中添加了依赖项,但它说:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/services/org.codehaus.groovy.transform.ASTTransformation
    File1: C:\Users\Muco\.gradle\caches\modules-2\files-2.1\org.codehaus.groovy\groovy-all\2.4.5\1730f61e9c9e59fd1b814371265334d7be0b8d2\groovy-all-2.4.5.jar
    File2: C:\Users\Muco\.gradle\caches\modules-2\files-2.1\org.gebish\geb-ast\0.13.1\ad8ac4809edf1964636ca2817e48d447c4c0c15b\geb-ast-0.13.1.jar
    File3: C:\Users\Muco\.gradle\caches\modules-2\files-2.1\org.gebish\geb-implicit-assertions\0.13.1\ecfb15862e11eaa6b7e1b8179dc60621ae0ff5a\geb-implicit-assertions-0.13.1.jar

我经常遇到“重复”问题,但我无法解决这个问题。在这种情况下我能做的最好的是什么?我的意思是我只是做Doc所说的并复制粘贴,但我得到了这些错误。

的build.gradle

apply plugin: 'com.android.application'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.muco.staemme"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}
}


dependencies {
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'

    compile "org.gebish:geb-core:0.13.1"
    compile "org.seleniumhq.selenium:selenium-firefox-driver:2.52.0"
    compile "org.seleniumhq.selenium:selenium-support:2.52.0"

}

the libs,which came with the dependencies

1 个答案:

答案 0 :(得分:0)

我只需要添加

android.packagingOptions {
    exclude 'META-INF/services/org.codehaus.groovy.transform.ASTTransformation'
    exclude 'META-INF/LICENSE.txt'
}

现在可行。