android代码混淆报错总结:java.io.IOException: Please correct the above warnings first

[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyAdapter
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyEvent
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.Dialog
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyAdapter
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyEvent
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.Dialog
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyEvent
[2012-06-01 14:06:03 - geoTest6.3] Warning: org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1: can't find referenced class java.awt.event.KeyEvent
[2012-06-01 14:06:03 - geoTest6.3] You should check if you need to specify additional program jars.
[2012-06-01 14:06:03 - geoTest6.3] Warning: there were 1773 unresolved references to classes or interfaces.
[2012-06-01 14:06:03 - geoTest6.3] You may need to specify additional library jars (using '-libraryjars'),
[2012-06-01 14:06:03 - geoTest6.3] or perhaps the '-dontskipnonpubliclibraryclasses' option.
[2012-06-01 14:06:03 - geoTest6.3] Warning: there were 1 instances of library classes depending on program classes.
[2012-06-01 14:06:03 - geoTest6.3] You must avoid such dependencies, since the program classes will
[2012-06-01 14:06:03 - geoTest6.3] be processed, while the library classes will remain unchanged.
[2012-06-01 14:06:03 - geoTest6.3] java.io.IOException: Please correct the above warnings first.
[2012-06-01 14:06:03 - geoTest6.3] at proguard.Initializer.execute(Initializer.java:308)
[2012-06-01 14:06:03 - geoTest6.3] at proguard.ProGuard.initialize(ProGuard.java:210)
[2012-06-01 14:06:03 - geoTest6.3] at proguard.ProGuard.execute(ProGuard.java:85)
[2012-06-01 14:06:03 - geoTest6.3] at proguard.ProGuard.main(ProGuard.java:499)
[2012-06-01 14:12:33 - geoTest6.3] Proguard returned with error code 1. See console

解决办法:因为采用了三方的jar包,需要我们在 proguard.cfg 中添加"-dontwarn"

如下:

proguard.cfg 全部配置

-dontwarn
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

可解决!

文章来源:http://www.cnblogs.com/zfrr/archive/2012/06/01/2530744.html

更多相关文章

  1. 新建Cocos2dx-Android工程
  2. android 动态添加View
  3. Andriod开发之浏览器开发(WebView)
  4. 【Android】App界面与顶部状态栏重叠遮盖问题
  5. android 刚进入activity 时关闭输入法
  6. Android(安卓)Bundle类
  7. Android(安卓)按钮添加单击事件
  8. android studio 添加项目修改gradle2.2.3
  9. Android官方入门文档[6]添加Action按钮

随机推荐

  1. 使用Android(安卓)OpenGL ES 2.0绘图之四
  2. Android出现Attempt to invoke virtual m
  3. android蓝牙开发:无法发现蓝牙设备的问题
  4. 请教Android内置应用Browser编译成APK的
  5. PanaBoard移植Android
  6. Service显示启动和隐式启动
  7. Android之发送短信的两种方式
  8. 【Android】(已更新解决方案)更新SDK版本(25
  9. Android按返回键(后退键)Back键事件捕获的
  10. Android——自定义ImageView实现圆形图片