android 打包遇到的问题

简介:

说说今天打包遇到的坑,由于线上有个支付的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行了吧,形如:

[objc]  view plain  copy
 print ? 在CODE上查看代码片 派生到我的代码片
  1. buildTypes {  
  2.     release {  
  3.         minifyEnabled true  
  4.         shrinkResources true  
  5.         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  
  6.     }  
  7.     debug {  
  8.         minifyEnabled false  
  9.         shrinkResources false  
  10.         proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  
  11.     }  
  12. }  
3,我又重新编译,结果报Android Studio 混淆打包 IOException: Please correct the above warnings first,形如下面的错误

[objc]  view plain  copy
 print ? 在CODE上查看代码片 派生到我的代码片
  1. Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory    
  2. Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log    
  3. Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory    
  4. Warning:org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.Log    
  5. Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory    
  6. Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log    
  7. Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory    
  8. Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.Log    
  9. Warning:org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1: can't find referenced class org.apache.commons.logging.Log    
  10. Warning:there were 210 unresolved references to classes or interfaces.    
  11.          You may need to add missing library jars or update their versions.    
  12.          If your code works fine without the missing classes, you can suppress    
  13.          the warnings with '-dontwarn' options.    
  14.          (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)    
  15. Warning:there were 1 unresolved references to library class members.    
  16.          You probably need to update the library versions.    
  17.          (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)    
  18. :app:proguardRelease FAILED    
  19. Error:Execution failed for task ':app:proguardRelease'.    
  20. > java.io.IOException: Please correct the above warnings first.    


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

[objc]  view plain  copy
 print ? 在CODE上查看代码片 派生到我的代码片
  1. 打包报错java.io.IOException: Please correct the above warnings first.  
  2. -dontwarn org.apache.http.**  



目录
相关文章
|
2月前
|
Java 开发工具 Android开发
cordova打包android apk
cordova打包android apk
15 0
|
2月前
|
Android开发 数据安全/隐私保护
打包 android apk签名
打包 android apk签名
19 0
|
3月前
|
JavaScript 前端开发 Java
React-Native Android打包
React-Native Android打包
31 0
|
3月前
|
JavaScript Android开发
Cordova 打包 Vue 项目到Android打开白屏
Cordova 打包 Vue 项目到Android打开白屏
|
5月前
|
小程序 开发工具 Android开发
Donut多端框架小程序打包适配ios和安卓app
腾讯新出了一个 Donut 多端框架,可以直接将微信小程序转成 ios 和 安卓 app,小程序开发者工具里也集成了 app 相关升级、调试和打包的功能,终于可以一套代码开发出3个客户端了!
127 0
Donut多端框架小程序打包适配ios和安卓app
|
5月前
|
Android开发
Hbuilder打包android安装包流程
Hbuilder打包android安装包流程
|
7月前
|
Android开发
qt打包安卓报http请求错误
qt打包安卓报http请求错误
42 0
|
7月前
|
图形学 Android开发
Unity打包安卓报http请求错误
Unity打包安卓报http请求错误
70 1
|
8月前
|
Android开发
cocoscreator打包 android 无法访问appcompatactivity的问题
cocoscreator打包 android 无法访问appcompatactivity的问题
|
8月前
|
Java Android开发
Android 进行友盟多渠道打包步骤详解
Android 进行友盟多渠道打包步骤详解
197 0