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

转载 2013年12月03日 17:58:24

http://www.cnblogs.com/zfrr/archive/2012/06/01/2530744.html

 

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 *;
}

可解决! 

 

相关文章推荐

SpringMVC之web.xml,了解必要配置项

本篇先来介绍web.xml,了解其中必要的配置项,为以后顺利开发打下坚实基础。

Android 代码混淆异常 transformClassesAndResourcesWithProguardForRelease FAILED

前几天混淆代码,出现了 这个异常  Warning:Exception while processing task java.io.IOException: Please correct th...

Proguard混淆Android项目所遇问题及总结

Proguard混淆Android项目所遇问题及总结 最近一个老项目需要添加混淆, 因此又对混淆有了更深入的了解. 在此过程中遇到了一下问题, 记录如下:  1. 编译打包错误 a. 类重复, 错...

自定义Android混淆规则--proguard-rules.pro

#指定代码的压缩级别 -optimizationpasses 5 #包名不混合大小写 -dontusemixedcaseclassnames #不去忽略非公共的库类 -dontskipnonpub...

Gradle build报错:Please correct the above warnings first解决方案

转载:gradle build报错:Please correct the above warnings first解决方案问题描述:在编译的时候,出现了下面的错误提示Warning: there we...

Android 混淆机制

转自: http://blog.csdn.net/jjwwmlp456/article/details/44977721 语法规范说明地址:https://stuff.mit.edu/afs/...

Android Studio 混淆打包 IOException: Please correct the above warnings first

Android studio 混淆打包时,出现Error:Execution failed for task ':app:proguardRelease'. > java.io.IOExcept...

android 读写sd卡的权限设置

在Android中,要模拟SD卡,要首先使用adb的mksdcard命令来建立SD卡的镜像,如何建立,大家上网查一下吧,应该很容易找到,这里不说这个问题.     但是在应用程序执行起来以后,我...

android studio 混淆后,打包报错!!!

android studio 混淆后,打包报错!!!
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)