使用微信SDK后APK打包失败
APP集成了微信分享功能,但是打包时出现错误,仔细检查了proguard配置,感觉配置正确,深表微信sdk自身问题;跑官方找反馈链接未果,只好自己上网查。
ProGuard官网bug反馈中有记载同类错误(http://sourceforge.net/p/proguard/bugs/420/),有人给出解决方案,将ClassConstants.java中StackMapTable属性改为dummy,重新编译即可。
另外在CSDN上发现有好心人前几天已遇到类似问题,并已将ProGuard编译好,那我们就省事了,拿来直接用好了。经测试可用,感谢Gavin_Mirror同学的无私奉献! 原址在这http://blog.csdn.net/jiguangcanhen/article/details/41806599, 解释的很详细,我就不重复了。
鉴于sourceforge.net国内访问不便,以及csdn现在的网页搞的很不友好,初始化js加载了好多国内无法访问的第三方链接(如acs86.com、google-analytics.com、gstatic.com等等等等),打开灰常慢,我在这里分享下Gavin_Mirror同学的ProGuard包
最后附错误信息如下:
[2014-12-29 22:54:09 - MG] Proguard returned with error code 1. See console
[2014-12-29 22:54:09 - MG] java.io.IOException: Can't read [/Users/xxxx/workspace/xx_project/libs/libammsdk.jar] (Can't process class [com/tencent/wxop/stat/al.class] (Unknown verification type [95] in stack map frame))
[2014-12-29 22:54:09 - MG] at proguard.InputReader.readInput(InputReader.java:230)
[2014-12-29 22:54:09 - MG] at proguard.InputReader.readInput(InputReader.java:200)
[2014-12-29 22:54:09 - MG] at proguard.InputReader.readInput(InputReader.java:178)
[2014-12-29 22:54:09 - MG] at proguard.InputReader.execute(InputReader.java:78)
[2014-12-29 22:54:09 - MG] at proguard.ProGuard.readInput(ProGuard.java:196)
[2014-12-29 22:54:09 - MG] at proguard.ProGuard.execute(ProGuard.java:78)
[2014-12-29 22:54:09 - MG] at proguard.ProGuard.main(ProGuard.java:492)
[2014-12-29 22:54:09 - MG] Caused by: java.io.IOException: Can't process class [com/tencent/wxop/stat/al.class] (Unknown verification type [95] in stack map frame)
[2014-12-29 22:54:09 - MG] at proguard.io.ClassReader.read(ClassReader.java:112)
[2014-12-29 22:54:09 - MG] at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[2014-12-29 22:54:09 - MG] at proguard.io.JarReader.read(JarReader.java:65)
[2014-12-29 22:54:09 - MG] at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
[2014-12-29 22:54:09 - MG] at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
[2014-12-29 22:54:09 - MG] at proguard.InputReader.readInput(InputReader.java:226)
[2014-12-29 22:54:09 - MG] ... 6 more
[2014-12-29 22:54:09 - MG] Caused by: java.lang.RuntimeException: Unknown verification type [95] in stack map frame
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.createVerificationType(ProgramClassReader.java:890)
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.visitFullFrame(ProgramClassReader.java:659)
[2014-12-29 22:54:09 - MG] at proguard.classfile.attribute.preverification.FullFrame.accept(FullFrame.java:114)
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.visitStackMapTableAttribute(ProgramClassReader.java:452)
[2014-12-29 22:54:09 - MG] at proguard.classfile.attribute.preverification.StackMapTableAttribute.accept(StackMapTableAttribute.java:71)
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.visitCodeAttribute(ProgramClassReader.java:422)
[2014-12-29 22:54:09 - MG] at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.visitProgramMethod(ProgramClassReader.java:200)
[2014-12-29 22:54:09 - MG] at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:142)
[2014-12-29 22:54:09 - MG] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2014-12-29 22:54:09 - MG] at proguard.io.ClassReader.read(ClassReader.java:91)
[2014-12-29 22:54:09 - MG] ... 11 more