在Eclipse打包工程时报如下错误:

[2014-01-06 08:58:44 - emp_android] Proguard returned with error code 1. See console

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b$a: can't find superclass or interface android.location.GpsStatus$NmeaListener

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced method 'int getLac()' in class android.telephony.NeighboringCellInfo

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.APS: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.e: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.e: can't find referenced method 'void onSignalStrengthsChanged(android.telephony.SignalStrength)' in class android.telephony.PhoneStateListener

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.e: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.e: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.i: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.i: can't find referenced method 'void onSignalStrengthsChanged(android.telephony.SignalStrength)' in class android.telephony.PhoneStateListener

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.i: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.autonavi.aps.api.i: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced method 'boolean addNmeaListener(android.location.GpsStatus$NmeaListener)' in class android.location.LocationManager

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced method 'void removeNmeaListener(android.location.GpsStatus$NmeaListener)' in class android.location.LocationManager

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b: can't find referenced class android.location.GpsStatus$NmeaListener

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.b$a: can't find referenced class android.location.GpsStatus$NmeaListener

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c: can't find referenced class android.telephony.cdma.CdmaCellLocation

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$a: can't find referenced method 'int getLac()' in class android.telephony.NeighboringCellInfo

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.baidu.location.c$b: can't find referenced class android.telephony.SignalStrength

[2014-01-06 08:58:44 - emp_android] Warning: com.lakala.b.b$2: can't find referenced method 'boolean isWiredHeadsetOn()' in class android.media.AudioManager

[2014-01-06 08:58:44 - emp_android] Warning: com.lingtu.mapapi.MapView: can't find referenced method 'int getPointerCount()' in class android.view.MotionEvent

[2014-01-06 08:58:44 - emp_android]       You should check if you need to specify additional program jars.

[2014-01-06 08:58:44 - emp_android] Warning: there were 20 unresolved references to classes or interfaces.

[2014-01-06 08:58:44 - emp_android]          You may need to specify additional library jars (using '-libraryjars').

[2014-01-06 08:58:44 - emp_android] Warning: there were 8 unresolved references to program class members.

[2014-01-06 08:58:44 - emp_android]          Your input classes appear to be inconsistent.

[2014-01-06 08:58:44 - emp_android]          You may need to recompile them and try again.

[2014-01-06 08:58:44 - emp_android]          Alternatively, you may have to specify the option

[2014-01-06 08:58:44 - emp_android]          '-dontskipnonpubliclibraryclassmembers'.

[2014-01-06 08:58:44 - emp_android] java.io.IOException: Please correct the above warnings first.

[2014-01-06 08:58:44 - emp_android]at proguard.Initializer.execute(Initializer.java:321)

[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.initialize(ProGuard.java:211)

[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.execute(ProGuard.java:86)

[2014-01-06 08:58:44 - emp_android]at proguard.ProGuard.main(ProGuard.java:492)

大体意思是找不到相关的类或者方法,因为工程引入了第三方包,混淆的时候如果把第三方包也混淆了,那么相关的类在使用这些包的时候就会找不到相关方法。

因此在proguard.cfg加上以下代码:

[html] view plaincopy
  1. -dontwarn com.baidu.**
  2. -keep class com.baidu.** { *;}
  3. -dontwarn com.lakala.**
  4. -keep class com.lakala.** { *;}
  5. -dontwarn com.lingtu.**
  6. -keep class com.lingtu.** { *;}
  7. -dontwarn com.autonavi.**
  8. -keep class com.autonavi.** { *;}

其实找不到引用的这个类是第三方包里面的,而且很多时候我们只需要打乱自己的代码就行了,第三方包的代码就是否要打乱就不要管了。我们可以使用

-dontwarn com.xx.bbb.**
-keep class com.xx.bbb.** { *;}

参数来保持第三方库中的类而不乱,-dontwarn和-keep 结合使用,意思是保持com.xx.bbb.**这个包里面的所有类和所有方法而不混淆,接着还叫ProGuard不要警告找不到com.xx.bbb.**这个包里面的类的相关引用。
配置好后,重新打包,一切OK!而且程序能正确运行

(本文参考http://blog.csdn.net/u_xtian/article/details/7495023)

Proguard打包混淆报错:can't find superclass or interface相关推荐

  1. Pyinstaller 打包exe 报错 “failed to execute script XXX“的一种解决方案

    Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案 参考文章: (1)Pyinstaller 打包exe 报错 & ...

  2. vue cli 项目在打包时候报错 API fatal error handler returned after process out of memory

    问题描述 vue cli 项目在打包时候报错:API fatal error handler returned after process out of memory. 问题分析 从给出的提示可以看出 ...

  3. vue cli 项目在打包时候报错解决方法

    问题描述 报错一: 打包过程报错:Unexpected token name <i>, expected punc <;> IE浏览中报错:SCRIPT1003: 缺少':', ...

  4. python打包工具报错_Python打包发布神器—Pyinstaller

    一前言 在windows平台学习python的过程中,你肯定会遇到需要把.py脚本打包成.exe的情形,如此,至少有两方面的好处:第一,你的代码保密性更好,其他人不能直接看到python代码:第二,打 ...

  5. VSCode内npm run build编译打包时候报错:code ELIFECYCLE - (已解决)

    文章目录 win10系统使用VSCode打包项目进行build编译的时候,报错:Module build failed: Error: "extract-text-webpack-plugi ...

  6. maven打包maven-shade-plugin报错Non-parseable POM解决方法

    maven打包maven-shade-plugin报错Non-parseable POM解决方法 参考文章: (1)maven打包maven-shade-plugin报错Non-parseable P ...

  7. pyinstaller打包icon报错

    pyinstaller打包icon报错 用pyinstaller打包exe文件时,是可以设置图标的,但如果没有设置好,就会报错. 我在打包的时候报了一个错 except win32api.error ...

  8. Unity PIC 打包assetBundle报错

    Unity PIC 打包assetBundle报错 修改平台设置,讲LitJson 从android 目录移出来,重启unity.就可以读取到引用关系了.

  9. 【Hbuilder】Hbuilder 原生App-云打包,报错需要打包校验

    文章目录 一.前言 二.报错截图 三.解决: 一.前言 使用Hbuild uni-app开发完项目后,安装完App云打包,点击发行>原生App云打包,报错提示打包校验 二.报错截图 三.解决: ...

  10. uglifyjs报错 webpack_vue 解决uglifyjs-webpack-plugin打包出现报错的问题

    楼主最新对已做项目进行打包优化,配置了打包环境下去除console.log语句插件---使用uglifyjs-webpack-plugin 具体代码如下 npm install uglifyjs-we ...

最新文章

  1. Spring框架笔记(二十二)——切点表达式的重用
  2. SAP Commerce Cloud OAuth 实现介绍
  3. Spring Boot和Apache Camel
  4. Angular问题03 @angular/material版本问题
  5. Python自定义包
  6. Bipartite Segments CodeForces - 901C (区间二分图计数)
  7. JDK1.8源码(十一)——java.util.TreeMap类
  8. python实现嵌套列表按指定位置元素排序、按子列表长度、子列表之和、绝对值和、最大/最小值排序
  9. 三菱FX系列PLC教程
  10. PRINCE2认证的优势是什么?
  11. Python简单数据清洗
  12. SecureCRT的安装破解
  13. 万物并作,吾以观复|OceanBase 政企行业实践
  14. 麦块java文件夹_我的世界游戏文件夹目录作用介绍 各个文件夹都是什么用
  15. 计算机网络共享文件共享,终于发现如何取消计算机网络共享文件
  16. 1513_人月神话阅读笔记_再论没有银弹
  17. dll占的究竟是谁的空间?——浅谈Windows内存机制
  18. 使用adb从手机拉取apk包
  19. 如何利用python将excel表格中筛选出来的每一份数据各自另存为新的excel文件?
  20. 客户端连接服务器,配置出错“连接超时”或者“无监听程序”解决方法

热门文章

  1. 公司法定代表人的法律风险及防范
  2. 桩身弹性压缩计算公式_桩身弹性压缩量计算
  3. 黑苹果10.15.7安装comfast永存,CF-811AC驱动方法
  4. 用JSDoc生成js文档
  5. 电动按摩帖芯片FH8B23S16B单片机为什么这么多人用?
  6. matlab仿真脉冲响应函,Matlab仿真下的动态响应分析
  7. C 语言绝对值函数abs实现技巧
  8. 开源资产管理软件OCS Inventory 实践
  9. Flask框架的学习——11—(WTForms表单验证-常用验证器、文件上传、上传文件名称中文问题、验证上传文件格式)
  10. Electron 仿制WeGame(二)