首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >签名APK Proguard错误重复压缩条目okio-1.6.0.jar:okio/AsyncTimeout$1.class

签名APK Proguard错误重复压缩条目okio-1.6.0.jar:okio/AsyncTimeout$1.class
EN

Stack Overflow用户
提问于 2017-07-18 07:47:21
回答 1查看 252关注 0票数 0

我知道以前问过这个问题,但在设置minifyEnabled=true后生成签名的apk文件时出错了,下面是控制台中的消息显示

代码语言:javascript
复制
Warning:Exception while processing task java.io.IOException: Can't write
 [E:\andriod_app_v2\app
 \build\intermediates\transforms\proguard\release\jars\3\1f\main.jar] 
 (Can't read [C:\Users\Administrator\.gradle\
 caches\modules-2\files-2.1\com.squareup.okio\okio\1.6.0\98476622f10715998eacf9240d6b479f12c66143\okio-1.6.0.jar(;;;;;;**.class)]
 (Duplicate zip entry [f/a$1.class == okio-1.6.0.jar:okio/AsyncTimeout$1.class]))

我搜索了堆叠溢出,但我没有得到任何适当的解决方案,谁能帮我解决这个问题。

EN

回答 1

Stack Overflow用户

发布于 2017-07-18 08:01:42

在文件保护程序中使用这个规则。

代码语言:javascript
复制
##--------------------------------------------------------------------------------------------------
#### -- OkHttp --
-dontwarn com.squareup.okhttp.internal.**

#### -- Apache Commons --
-dontwarn org.apache.commons.logging.**


-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-keep class android.net.http.** { *; }
-dontwarn android.net.http.**

##--------------------------------------------------------------------------------------------------
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
-dontwarn okio.**
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45160570

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档