You can ignore those files in your build.gradle

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportSupportV42000Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug
Warning:Ignoring InnerClasses attribute for an anonymous inner class
(com.tencent.mm.sdk.b.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
:app:dexDebug
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug
Error:duplicate files during packaging of APK /Users/luffy/AndroidStudioProjects/sporting-android1/app/build/outputs/apk/app-debug-unaligned.apk
Path in archive: META-INF/NOTICE.txt
Origin 1: /Users/luffy/AndroidStudioProjects/sporting-android1/app/libs/httpclient-cache-4.2.1.jar
Origin 2: /Users/luffy/AndroidStudioProjects/sporting-android1/app/libs/httpmime-4.2.1.jar
You can ignore those files in your build.gradle:
android {
 packagingOptions {
   exclude 'META-INF/NOTICE.txt'
 }
}
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK META-INF/NOTICE.txt
   File 1: /Users/luffy/AndroidStudioProjects/sporting-android1/app/libs/httpclient-cache-4.2.1.jar

  File 2: /Users/luffy/AndroidStudioProjects/sporting-android1/app/libs/httpclient-cache-4.2.1.jar


因为 httpclient-cache-4.2.1.jar 和  httpmime-4.2.1.jar 包含了同样的文件。

根据提示在 build.gradle 里面增加:

[java]  view plain copy print ?
  1. android {  
  2.       packagingOptions {  
  3.         exclude 'META-INF/NOTICE.txt'  
  4.       }  
  5.     }  


转载:http://blog.csdn.net/baduspace/article/details/42458355
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值