Android - butterKnife与realm同时依赖;可能出现app:transformResourcesWithMergeJavaResForDebug错误



Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor	File1: C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\com.jakewharton\butterknife\7.0.1\d5d13ea991eab0252e3710e5df3d6a9d4b21d461\butterknife-7.0.1.jar	File2: C:\Users\Administrator\.gradle\caches\modules-2\files-2.1\io.realm\realm-android\0.87.5\ab4e1fead1380252dad0e95658e53ea0c113e89c\realm-android-0.87.5.jar

// butterKnife
compile 'com.jakewharton:butterknife:7.0.1'
//realm
compile 'io.realm:realm-android:0.87.5' // dependency for realm-database API (http://realm.io)

解决方案:在app 的build.gradle的文件下  android下添加
android {
packagingOptions {
    exclude 'META-INF/NOTICE' // will not include NOTICE file
    exclude 'META-INF/LICENSE' // will not include LICENSE file
    exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值