【发布时间】:2016-03-28 06:31:28
【问题描述】:
我在 Android Studio 中遇到了这个问题。
【问题讨论】:
-
httpclient 已弃用。你应该改用 httpurlconnection
标签: android android-studio httpclient apache-httpclient-4.x
我在 Android Studio 中遇到了这个问题。
【问题讨论】:
标签: android android-studio httpclient apache-httpclient-4.x
将此添加到您应用的 build.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'
}
【讨论】:
正如错误消息所示,您并未排除存在于多个依赖项中的 META-INF/NOTICE 文件
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: 在 APK META-INF/NOTICE 中复制的文件重复
packagingOptions {
exclude 'META-INF/LICENSE' // will not include NOTICE file
exclude 'META-INF/NOTICE' // will not include NOTICE file
}
【讨论】: