More than one file was found with OS independent path 'org/apache/http/client/version.properties'

11,889

Just add

packagingOptions {
    exclude 'org/apache/http/version.properties'
    exclude 'org/apache/http/client/version.properties'
}

in your app build.xml then Clean/sync project. Hope this helps.

Share:
11,889

Related videos on Youtube

Amar Sharma
Author by

Amar Sharma

Updated on June 04, 2022

Comments

  • Amar Sharma
    Amar Sharma almost 2 years

    Every thing working fine before updating Android studio from 2.3 to 3.0. I had this error when running app in Android Studio, complile is pass. I can't understand why this error appears. And I found nothing in Internet.

    here is my gradle file.

     packagingOptions {
    
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LGPL2.1'
    
        }
    }
    
    repositories {
        mavenCentral()
        google()
    }
    
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile files('libs/DraggableGridView.jar')
        compile files('libs/httpclient-4.3.6.jar')
        compile files('libs/httpcore-4.3.3.jar')
        compile files('libs/httpmime-4.3.6.jar')
        compile files('libs/android-query-full.0.26.7.jar')
        compile project(':gestureimageview')
        compile files('libs/commons-lang3-3.5.jar')
        compile files('libs/json_simple-1.1.jar')
        compile('com.google.api-client:google-api-client-android:1.22.0') {
            exclude group: 'org.apache.httpcomponents'
        }
    
        compile group: 'com.dropbox.core', name: 'dropbox-core-sdk', version: '3.0.4', changing: true
    
        //    compile 'com.dropbox.core:dropbox-core-sdk:3.0.4'
    
        //    compile 'ly.img.android:photo-editor-sdk:5.0.0-beta'
    
        //    compile 'com.github.thorbenprimke:realm-searchview:0.9.6'
        //    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.2'
    
        //    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.2'
    
        compile 'com.squareup.okhttp:okhttp:2.7.5'
        compile 'com.squareup.okhttp3:okhttp:3.7.0'
        compile 'com.matthew-tamlin:sliding-intro-screen:3.2.0'
        compile 'com.instabug.library:instabug:4.3.0'
        compile 'com.android.support:appcompat-v7:25.4.0'
        compile 'com.android.support:support-v4:25.4.0'
        compile 'com.android.support:design:25.4.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.android.support:recyclerview-v7:25.4.0'
        compile 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
        compile 'com.android.support:cardview-v7:25.4.0'
        compile 'com.google.firebase:firebase-messaging:11.4.2'
        compile 'com.facebook.android:facebook-android-sdk:[4,5)'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.android.support:customtabs:25.4.0'
        compile 'com.android.support:palette-v7:25.4.0'
        compile 'com.android.support:multidex:1.0.2'
        compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
        compile 'ly.img.android:photo-editor-sdk:5.0.6'
        compile 'de.morrox.fontinator:Fontinator:1.1.3'
        compile 'com.google.android.gms:play-services-drive:11.4.2'
        compile 'com.romandanylyk:pageindicatorview:0.0.7'
        compile 'com.android.support:support-annotations:27.0.0'
        compile 'com.android.support:support-compat:25.4.0'
        compile 'com.android.support:support-core-ui:25.4.0'
        compile 'de.hdodenhof:circleimageview:2.0.0'
        compile 'pl.bclogic:pulsator4droid:1.0.3'
        compile 'com.google.android.gms:play-services-identity:11.4.2'
        compile 'com.google.http-client:google-http-client-gson:1.20.0'
        compile 'com.google.android.gms:play-services-auth:11.4.2'
        compile 'com.google.apis:google-api-services-drive:v2-rev247-1.22.0'
        testCompile 'junit:junit:4.12'
    

    }

    here is error I am getting every time

    Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. More than one file was found with OS independent path 'org/apache/http/client/version.properties'

  • Riddhi
    Riddhi over 5 years
    I am getting the same error. I Tried your solution. But it is still not working. can You help me?
  • amit srivastava
    amit srivastava over 5 years
    @Riddhi can't say without looking at your gradle script, share your gradle
  • Riddhi
    Riddhi over 5 years
    @amitsrivastava thanks but, Now I got the solution. There were 2 modules which were using the same library and in the lib folder, volley.jar was there. so, I removed it and added it via Gradle dependency