在OS独立路径中找到了多个文件' META-INF / DEPENDENCIES'

时间:2018-03-13 05:23:12

标签: android selenium selenium-webdriver

我添加Selenium WebDriver的Android项目。当我构建我的应用程序时,我收到错误:

More than one file was found with `OS` independent path `META-INF/DEPENDENCIES`
  

我的应用程序gradle:

android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.akmaral.diplom"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

  }
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
implementation files('libs/byte-buddy-1.7.9.jar')
implementation files('libs/client-combined-3.11.0.jar')
implementation files('libs/client-combined-3.11.0-sources.jar')
implementation files('libs/commons-codec-1.10.jar')
implementation files('libs/commons-exec-1.3.jar')
implementation files('libs/commons-logging-1.2.jar')
implementation files('libs/gson-2.8.2.jar')
implementation files('libs/guava-23.6-jre.jar')
implementation files('libs/httpclient-4.5.3.jar')
implementation files('libs/httpcore-4.4.6.jar')
implementation files('libs/okhttp-3.9.1.jar')
implementation files('libs/okio-1.13.0.jar')
}

2 个答案:

答案 0 :(得分:0)

添加packagingOptions

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.akmaral.diplom"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:26.1.0'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.1'
        implementation files('libs/byte-buddy-1.7.9.jar')
        implementation files('libs/client-combined-3.11.0.jar')
        implementation files('libs/client-combined-3.11.0-sources.jar')
        implementation files('libs/commons-codec-1.10.jar')
        implementation files('libs/commons-exec-1.3.jar')
        implementation files('libs/commons-logging-1.2.jar')
        implementation files('libs/gson-2.8.2.jar')
        implementation files('libs/guava-23.6-jre.jar')
        implementation files('libs/httpclient-4.5.3.jar')
        implementation files('libs/httpcore-4.4.6.jar')
        implementation files('libs/okhttp-3.9.1.jar')
        implementation files('libs/okio-1.13.0.jar')
    }
}

答案 1 :(得分:0)

 packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
}