博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PhoneGap/Cordova Android应用签名公布注意事项
阅读量:5995 次
发布时间:2019-06-20

本文共 10184 字,大约阅读时间需要 33 分钟。

今天最终要公布Android HybirdApp了,安装曾经做原生应用的流程公布签名Apk,没想到立即遇到了几个问题。如今把它们的解决的方法整理下来。

export signed Apk 遇到以下错误,这个问题是多次读取inputStream导致的,貌似和eclise的自己主动编译有关,解决的方法是关掉相关project的自己主动编译。

Export Signed APK 前先將 Eclipse 的 Project -> Build Automatically关闭,第一个坑解决!

[2014-07-25 10:50:58 - SalesApp] Proguard returned with error code 1. See console[2014-07-25 10:50:58 - SalesApp] java.io.IOException: Can't read [/Users/zhangxitao/work/salesapp/platforms/android/CordovaLib/bin/salesapp-cordovalib.jar] (Can't process class [com/squareup/okhttp/internal/spdy/SpdyConnection$Builder.class] (Unexpected end of ZLIB input stream))[2014-07-25 10:50:58 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:232)[2014-07-25 10:50:58 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:202)[2014-07-25 10:50:58 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:180)[2014-07-25 10:50:58 - SalesApp] 	at proguard.InputReader.execute(InputReader.java:78)[2014-07-25 10:50:58 - SalesApp] 	at proguard.ProGuard.readInput(ProGuard.java:196)[2014-07-25 10:50:58 - SalesApp] 	at proguard.ProGuard.execute(ProGuard.java:78)[2014-07-25 10:50:58 - SalesApp] 	at proguard.ProGuard.main(ProGuard.java:483)[2014-07-25 10:50:58 - SalesApp] Caused by: java.io.IOException: Can't process class [com/squareup/okhttp/internal/spdy/SpdyConnection$Builder.class] (Unexpected end of ZLIB input stream)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:112)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.JarReader.read(JarReader.java:65)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)[2014-07-25 10:50:58 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:228)[2014-07-25 10:50:58 - SalesApp] 	... 6 more[2014-07-25 10:50:58 - SalesApp] Caused by: java.lang.RuntimeException: Unexpected end of ZLIB input stream[2014-07-25 10:50:58 - SalesApp] 	at proguard.classfile.io.RuntimeDataInput.readInt(RuntimeDataInput.java:136)[2014-07-25 10:50:58 - SalesApp] 	at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:77)[2014-07-25 10:50:58 - SalesApp] 	at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)[2014-07-25 10:50:58 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:91)[2014-07-25 10:50:58 - SalesApp] 	... 12 more[2014-07-25 10:51:06 - SalesApp] Proguard returned with error code 1. See console[2014-07-25 10:51:06 - SalesApp] java.io.IOException: Can't read [/Users/zhangxitao/work/salesapp/platforms/android/CordovaLib/bin/salesapp-cordovalib.jar] (Can't process class [com/squareup/okhttp/internal/http/HttpDate.class] (Unexpected end of ZLIB input stream))[2014-07-25 10:51:06 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:232)[2014-07-25 10:51:06 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:202)[2014-07-25 10:51:06 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:180)[2014-07-25 10:51:06 - SalesApp] 	at proguard.InputReader.execute(InputReader.java:78)[2014-07-25 10:51:06 - SalesApp] 	at proguard.ProGuard.readInput(ProGuard.java:196)[2014-07-25 10:51:06 - SalesApp] 	at proguard.ProGuard.execute(ProGuard.java:78)[2014-07-25 10:51:06 - SalesApp] 	at proguard.ProGuard.main(ProGuard.java:483)[2014-07-25 10:51:06 - SalesApp] Caused by: java.io.IOException: Can't process class [com/squareup/okhttp/internal/http/HttpDate.class] (Unexpected end of ZLIB input stream)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:112)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.JarReader.read(JarReader.java:65)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)[2014-07-25 10:51:06 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:228)[2014-07-25 10:51:06 - SalesApp] 	... 6 more[2014-07-25 10:51:06 - SalesApp] Caused by: java.lang.RuntimeException: Unexpected end of ZLIB input stream[2014-07-25 10:51:06 - SalesApp] 	at proguard.classfile.io.RuntimeDataInput.readInt(RuntimeDataInput.java:136)[2014-07-25 10:51:06 - SalesApp] 	at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:77)[2014-07-25 10:51:06 - SalesApp] 	at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)[2014-07-25 10:51:06 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:91)[2014-07-25 10:51:06 - SalesApp] 	... 12 more[2014-07-25 10:51:20 - SalesApp] Proguard returned with error code 1. See console[2014-07-25 10:51:20 - SalesApp] java.io.IOException: Can't read [/Users/zhangxitao/work/salesapp/platforms/android/CordovaLib/bin/salesapp-cordovalib.jar] (Can't process class [com/squareup/okhttp/internal/http/HttpTransport.class] (Unexpected end of ZLIB input stream))[2014-07-25 10:51:20 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:232)[2014-07-25 10:51:20 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:202)[2014-07-25 10:51:20 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:180)[2014-07-25 10:51:20 - SalesApp] 	at proguard.InputReader.execute(InputReader.java:78)[2014-07-25 10:51:20 - SalesApp] 	at proguard.ProGuard.readInput(ProGuard.java:196)[2014-07-25 10:51:20 - SalesApp] 	at proguard.ProGuard.execute(ProGuard.java:78)[2014-07-25 10:51:20 - SalesApp] 	at proguard.ProGuard.main(ProGuard.java:483)[2014-07-25 10:51:20 - SalesApp] Caused by: java.io.IOException: Can't process class [com/squareup/okhttp/internal/http/HttpTransport.class] (Unexpected end of ZLIB input stream)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:112)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.JarReader.read(JarReader.java:65)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)[2014-07-25 10:51:20 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:228)[2014-07-25 10:51:20 - SalesApp] 	... 6 more[2014-07-25 10:51:20 - SalesApp] Caused by: java.lang.RuntimeException: Unexpected end of ZLIB input stream[2014-07-25 10:51:20 - SalesApp] 	at proguard.classfile.io.RuntimeDataInput.readInt(RuntimeDataInput.java:136)[2014-07-25 10:51:20 - SalesApp] 	at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:77)[2014-07-25 10:51:20 - SalesApp] 	at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)[2014-07-25 10:51:20 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:91)[2014-07-25 10:51:20 - SalesApp] 	... 12 more[2014-07-25 10:54:53 - SalesApp] Proguard returned with error code 1. See console[2014-07-25 10:54:53 - SalesApp] java.io.IOException: Can't read [/Users/zhangxitao/work/salesapp/platforms/android/CordovaLib/bin/salesapp-cordovalib.jar] (Can't process class [com/squareup/okhttp/internal/http/HttpEngine.class] (Unexpected end of ZLIB input stream))[2014-07-25 10:54:53 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:232)[2014-07-25 10:54:53 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:202)[2014-07-25 10:54:53 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:180)[2014-07-25 10:54:53 - SalesApp] 	at proguard.InputReader.execute(InputReader.java:78)[2014-07-25 10:54:53 - SalesApp] 	at proguard.ProGuard.readInput(ProGuard.java:196)[2014-07-25 10:54:53 - SalesApp] 	at proguard.ProGuard.execute(ProGuard.java:78)[2014-07-25 10:54:53 - SalesApp] 	at proguard.ProGuard.main(ProGuard.java:483)[2014-07-25 10:54:53 - SalesApp] Caused by: java.io.IOException: Can't process class [com/squareup/okhttp/internal/http/HttpEngine.class] (Unexpected end of ZLIB input stream)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:112)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.JarReader.read(JarReader.java:65)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)[2014-07-25 10:54:53 - SalesApp] 	at proguard.InputReader.readInput(InputReader.java:228)[2014-07-25 10:54:53 - SalesApp] 	... 6 more[2014-07-25 10:54:53 - SalesApp] Caused by: java.lang.RuntimeException: Unexpected end of ZLIB input stream[2014-07-25 10:54:53 - SalesApp] 	at proguard.classfile.io.RuntimeDataInput.readInt(RuntimeDataInput.java:136)[2014-07-25 10:54:53 - SalesApp] 	at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:77)[2014-07-25 10:54:53 - SalesApp] 	at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)[2014-07-25 10:54:53 - SalesApp] 	at proguard.io.ClassReader.read(ClassReader.java:91)[2014-07-25 10:54:53 - SalesApp] 	... 12 more

Proguard 会混淆cordova及其插件的java代码,导致apk执行时报 cordova error initial class,解决的方法是在proguard-project.txt 增加以下的内容,不混淆cordova及其插件

cordova 3.0以上版本号加

-keep class org.apache.cordova.** { *; }-keep public class * extends org.apache.cordova.CordovaPlugin

转载于:https://www.cnblogs.com/gavanwanggw/p/6956461.html

你可能感兴趣的文章
ORA-12720: operation requires database is in EXCLUSIVE mode
查看>>
ELK日志服务使用-kafka传输日志(bbotte.com)
查看>>
linux系统之iptables其二命令注解
查看>>
Silverlight C# 游戏开发:高深莫测却浅显易懂的游戏开发
查看>>
AI将如何改变广告业,这里有三个计算机视觉应用案例
查看>>
标准ACL+扩展ACL+命名ACL
查看>>
Apache2.4.1编译安装报错解决
查看>>
Linux常用的基本命令14
查看>>
《zabbix进程组成结构与zabbix_agentd.conf配置文件参数详解》-3
查看>>
8-22学习练习[一个viewController整合增删移动功能]
查看>>
MySQL的字符集
查看>>
Nginx+Tomcat实现反向代理及动静分离
查看>>
Linux进程管理优化及性能评估工具介绍
查看>>
网络服务器应用深入实践(第2版)
查看>>
javascript计算器小程序
查看>>
python 列表
查看>>
ORACLE 10G 配置OEM/DB CONSOLE
查看>>
网路岗 - Cisco 交换机端口镜像配置图解
查看>>
Swift开发笔记2.浅谈闭包
查看>>
Exchange2013与Office365做Exchange Online混合部署(五)之迁移邮箱
查看>>