今天终于完成了近一个月的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

最后,重新打包,一切OK。

Android程序进行混淆,在导出签名apk包时出错!的更多相关文章

  1. VS 中NuGet 尝试还原程序包时出错"*"已拥有为"**"定义的依赖项

    之前从Git检出项目以后,项目编译不能通过,发现是缺少依赖的外部插件,于是通过NuGet去获取项目依赖的插件,如何通过NuGet恢复使用的插件请使用NuGet还原项目插件. 但是就是在使用NuGet还 ...

  2. android studio 代码混淆如何忽略第三方jar包

    日前在打包混淆包含第三方jar包的Android studio项目时 报出了各种错误,但是debug版本却能正常运行,于是怀疑android studio 打包的时候把第三方jar包给混淆了,第三方j ...

  3. Xcode9 打包ipa(导出ipa测试包)时总是意外退出

    今天用xcode9,打包ipa总是意外退出. 正处在测试阶段,所以打的也是测试包 ,路径是:Product -> Archive -> Export -> Save for Ad H ...

  4. eclipse导出签名apk的混淆设置

    1.设置project.properties文件: 2.设置proguard-project.txt文件:

  5. 两个android程序间的相互调用(apk互调)

    通常我们用到的只是activity之间的互相跳转和调用,很少会用到apk级别的互相调用. 往往在一些应用上会用到,比如一个支付系统,可能会有很多的一系列的程序调用到:彩票系统.订票系统.团购网……全部 ...

  6. Android studio使用心得(二)— 打包签名apk发布

    1.—–Android Studio菜单   Build->Generate Signed APK 2.——Create new.. 3.——-跟eclipse里面一样,添加keystore 信 ...

  7. 将android程序中的数据库导出到SD卡

    private void copyDBToSDcrad() { String DATABASE_NAME = "数据库文件名"; String oldPath = "da ...

  8. Android实现应用下载并自动安装apk包

    安装: ? 1 2 3 4 5 String str = "/CanavaCancel.apk"; String fileName = Environment.getExterna ...

  9. myeclipse10.7导出war包时出错解决办法

    myeclipse10.7的版本破解后,导出war包时报“SECURITY ALERT: INTEGERITY CHECK ERROR”的错误. 选中项目->export->java ee ...

随机推荐

  1. Codeforces Round #238 (Div. 2) D. Toy Sum(想法题)

     传送门 Description Little Chris is very keen on his toy blocks. His teacher, however, wants Chris to s ...

  2. 简单的c# TCP通讯(TcpListener)

      简单的c# TCP通讯(TcpListener) C# 的TCP Socket (同步方式) C# 的TCP Socket (异步方式) C# 的tcp Socket设置自定义超时时间 C# TC ...

  3. kindeditor在光标处插入编辑器外的数据

    页面 <div class="form-group clearfix"> <label class="control-label col-sm-3 co ...

  4. [NHibernate]事务

    目录 写在前面 文档与系列文章 事务 增删改查 总结 写在前面 上篇文章介绍了nhibernate的增删改查方法及增加修改操作,这篇文章将介绍nhibernate的事务操作. SQL Server中的 ...

  5. 用 const 还是用 let?

    ES6 里新增了两种声明变量的方式,let 和 const,加上原来的 var,一共就有三种方式来声明变量了.那到底该用哪个呢?关于“尽可能不用 var” 这一点,大家应该没有什么意见分歧(其实还是有 ...

  6. win7提示“User Profile Service服务未能登录”

    注:本文由Colin撰写,版权所有!转载请注明原文地址,谢谢合作! 最近,有个同事打电话告诉我说他的用户名无法登陆到系统,提示“User Profile Service服务未能登录,无法加载用户配置文 ...

  7. WampServer数据库导入sql文件

    WampServer中MySQL如何导入sql文件: http://jingyan.baidu.com/article/3c343ff7f9c7940d377963c0.html

  8. PHP判断变量是否存在及函数isset() 、empty()与is_null的区别

    一.举例说明 A.如何判断一个变量是否定义? <?php // 假设不存在$test 变量 if (isset($test)) { echo '$test 已经set', '<br/> ...

  9. 父类方法返回子类实例:PHP延迟静态绑定

    案例分析 先前的PHP项目中,看到类似于以下的一段代码: <?php class DBHandler { public function get() { } } class MySQLHandl ...

  10. Swift3.0P1 语法指南——属性

    原档:https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programmi ...