前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >android打包引用第三方jar出现的错误

android打包引用第三方jar出现的错误

作者头像
xiangzhihong
发布2018-01-30 14:42:11
8300
发布2018-01-30 14:42:11
举报
文章被收录于专栏:向治洪

今天终于完成了近一个月的App开发工作,对程序进行混淆导出签名apk包时,却出现了如下的错误:

Proguard returned with error code 1. See console

Note: there were 4 duplicate class definitions.

Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser

Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser

。。。

心里想着,真是好事多磨呀!

那就赶紧问度娘呀,终于在一位网友那里找到了答案。

对于Android导入了第三方jar包时,proguard混淆脚本会出现错误,而出现上面的错误是因为程序中引入了第三方jar包[ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar],二话不说,立马行动:

在proguard-project.txt中增加了

-ignorewarnings

-libraryjars lib/ksoap2-android-assembly-2.5.4-jar-with-dependencies.jar (jar包路径)

即在文件中增加了如下红色的两行:

-dontusemixedcaseclassnames

-dontskipnonpubliclibraryclasses

-verbose

-ignorewarnings

# Optimization is turned off by default. Dex does not like code run

# through the ProGuard optimize and preverify steps (and performs some

# of these optimizations on its own).

-dontoptimize

#-dontoptimize

# Note that if you want to enable optimization, you cannot just

# include optimization flags in your own project configuration file;

# instead you will need to point to the

# "proguard-android-optimize.txt" file instead of this one from your

# project.properties file.

-libraryjars libs/ksoap2-android-assembly-2.6.5-jar-with-dependencies.jar 

-keepattributes *Annotation*

-keep public class com.google.vending.licensing.ILicensingService

-keep public class com.android.vending.licensing.ILicensingService

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2014-12-30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

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