前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Android打包遇到的那些坑

Android打包遇到的那些坑

作者头像
xiangzhihong
发布2018-02-05 15:48:15
7480
发布2018-02-05 15:48:15
举报
文章被收录于专栏:向治洪

说说今天打包遇到的坑,由于线上有个支付的bug需要紧急修复,而我们的项目又没有使用热修复,所以只能通过编译打包等传统流程,还好android上线比较快。

说说我进早上打包遇到的几个问题吧,首先我使用build-->generate signed apk然后输入签名打包,啪,给我报了一个错。

1,debug-stripped.ap_' specified for property 'resourceFile' does not exist.

这什么错,怎么一起没遇到过,马上度娘,找了半天找到一个和我很相似的,意思是android studio升级到2.2之后出现的错误,于是我也尝试了一把下面的方法:

File—>Settings,打开Settings界面,搜索到Instant Run。

,2怎么我的默认就是没选中的啊,于是看第二条,有人说是Debug模式下的混淆开关问题。

好我都把你改了,debug我都false行了吧,形如:

代码语言:javascript
复制
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled false
        shrinkResources false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

3,我又重新编译,结果报Android Studio 混淆打包 IOException: Please correct the above warnings first,形如下面的错误

代码语言:javascript
复制
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory  
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log  
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory  
Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log  
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory  
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log  
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory  
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log  
Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1: can't find referenced class org.apache.commons.logging.Log  
Warning:there were 210 unresolved references to classes or interfaces.  
         You may need to add missing library jars or update their versions.  
         If your code works fine without the missing classes, you can suppress  
         the warnings with '-dontwarn' options.  
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)  
Warning:there were 1 unresolved references to library class members.  
         You probably need to update the library versions.  
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)  
:app:proguardRelease FAILED  
Error:Execution failed for task ':app:proguardRelease'.  
> java.io.IOException: Please correct the above warnings first.  

好吧,我打开混淆文件(proguard-rules),首先我看到有人把下面的ignorewarning注释了,我擦,然后关闭,打包成功,不过这里加上下面的一段话

代码语言:javascript
复制
打包报错java.io.IOException: Please correct the above warnings first.
-dontwarn org.apache.http.**
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-11-17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档