-1

https://i.stack.imgur.com/hHNMR.jpg

There are say more than one file was found with os independent but i change all compile files version not run. I'm new in android studio so help me

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'})
    implementation 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.android.support:design:25.3.1'
    implementation 'de.hdodenhof:circleimageview:1.2.1'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.tapadoo.android:alerter:2.0.1'
    implementation 'com.google.android.gms:play-services-ads:10.0.0'
    implementation 'com.google.android.gms:play-services:10.0.0'
    implementation 'com.google.android.gms:play-services-appindexing:9.8.0'
    implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
    implementation 'com.android.support:cardview-v7:25.3.1'
    implementation 'com.kaopiz:kprogresshud:1.0.5'
    implementation files('libs/apache-commons-httpmime.jar')
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'org.apache.httpcomponents:httpclient:4.5'
    implementation 'com.google.code.gson:gson:2.2.4'
    testImplementation 'junit:junit:4.12'
}
shizhen
  • 12,251
  • 9
  • 52
  • 88
  • 1
    Possible duplicate of [More than one file was found with OS independent path 'META-INF/LICENSE'](https://stackoverflow.com/questions/44342455/more-than-one-file-was-found-with-os-independent-path-meta-inf-license) – Martin Zeitler Jan 06 '19 at 12:33
  • android { useLibrary 'org.apache.http.legacy' packagingOptions { exclude 'META-INF/DEPENDENCIES' } } – Samiul Ahmed Shisir Jan 06 '19 at 12:36
  • but when i try to run then Error: Program type already present: com.google.android.gms.internal.zznf – Samiul Ahmed Shisir Jan 06 '19 at 12:38

1 Answers1

0

You have to exclude (completely don't include any) or pickFirst (only one of those duplicated) inside your packagingOptions, e.g.

android {
    ...
    packagingOptions {
        ...
        exclude 'META-INF/DEPENDENCIES'
        // or use below
        // pickFirst 'META-INF/DEPENDENCIES'
        ...
    }
}

See more details here: https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html

shizhen
  • 12,251
  • 9
  • 52
  • 88