发现多个文件具有与操作系统无关的路径“org/apache/http/client/version.properties”

2024-02-14

在将 Android studio 从 2.3 更新到 3.0 之前,一切正常。我在Android Studio中运行应用程序时遇到此错误,编译通过。我不明白为什么会出现这个错误。我在互联网上什么也没找到。

这是我的 gradle 文件。

 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'

}

这是我每次都会遇到的错误

任务“:app:transformResourcesWithMergeJavaResForDebug”执行失败。 发现多个文件具有与操作系统无关的路径“org/apache/http/client/version.properties”


只需添加

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

然后在你的应用程序 build.xml 中 清理/同步项目。 希望这可以帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

发现多个文件具有与操作系统无关的路径“org/apache/http/client/version.properties” 的相关文章

随机推荐