在将Android Studio从2.3升级到3.0之前,每件事情都运转良好。在Android Studio中运行应用程序时遇到此错误,complile已通过。我无法理解为什么会出现此错误。我在网上找不到任何东西。
这是我的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'中找到多个文件
答案 0 :(得分:12)
添加
packagingOptions {
exclude 'org/apache/http/version.properties'
exclude 'org/apache/http/client/version.properties'
}
然后在你的app build.xml中 清理/同步项目。 希望这会有所帮助。