android - 在 Android Studio 中构建混淆器。出现错误

标签 android android-studio proguard

我正在尝试在 android studio 中为我的发布版本配置混淆器,但我收到以下错误和警告:

错误:任务“:myAccount_S:proguardRelease”执行失败。

java.io.IOException: Can't write [C:\Users\mgi\AndroidStudioProjects\MyProjects\myAccount_S\build\intermediates\classes-proguard\release\classes.jar] (Can't read [C:\Users\mgi\AndroidStudioProjects\MyAccountProjects\myAccount_S\build\intermediates\exploded-aar\MyAccountProjects\myLibrary\unspecified\libs\PushTracker-1.3.0-tracfone.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [PushTracker-1.3.0-tracfone.jar:com/mgage/push/tracker/PushManager$1.class])) :myAccount_S:proguardRelease FAILED Warning:can't write resource [META-INF/NOTICE] (Duplicate zip entry [jackson-databind-2.2.3.jar:META-INF/NOTICE]) Warning:can't write resource [META-INF/LICENSE] (Duplicate zip entry [jackson-databind-2.2.3.jar:META-INF/LICENSE])

gradle:

<pre><code>buildTypes { release { minifyEnabled true proguardFile getDefaultProguardFile('proguard-android.txt') } } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/MANIFEST' } </code></pre> <p> dependencies {</p>
compile project(':facebookSDK')
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile files('libs/BxLibrary-1.4.14.jar')
compile files('libs/commons-io-1.3.2.jar')
compile files('libs/jackson-annotations-2.2.3.jar')
compile files('libs/jackson-core-2.2.3.jar')
compile files('libs/jackson-databind-2.2.3.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/PushTracker-1.3.0.jar')
compile files('libs/robospice-1.4.14.jar')
compile files('libs/robospice-cache-1.4.14.jar')

最佳答案

只有当 jackson-databind-2.2.3.jar 被超过 1 个项目使用时,才会出现这种情况。唯一的解决办法是要么使用 maven 中央存储库,要么创建第三个项目并将其用作之前使用 jackson-databind-2.2.3.jar 的项目的依赖项。

关于android - 在 Android Studio 中构建混淆器。出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30577979/

相关文章:

android - 是否可以混淆 apk 中的部分类/包?

android - NullPointerException 由于尝试在空对象引用上调用虚拟方法 'android.os.IBinder android.view.SurfaceControl.getHandle()'

android - 添加 kotlin 协程和空间后无法进行发布构建、proguard 警告

android - 如何在android中的Asynctask中使用自定义进度条

Javascript 无法在移动设备上正确触发 - iOS/Android

java - 在 Fragment 中使用 Glide 以及 FirebaseDatabase 和 Storage 会导致 Glide.with(getActivity) Null 对象

android - 如何在 Android Studio 中使用 libGoogleAnalyticsV2.jar

java - Android 11 : Primary directory (invalid) not allowed for content://media/external/file allowed directories are [Download, 文档]

android - Android 3.0 Canary 中不显示预览

java - Graphhopper 演示项目无法在 Android Studio 上运行