我有一个我想用 progaurd 构建的应用程序我在这个应用程序中使用 ksoap 和 itext jar 现在问题是在以发布模式(签名 apk)构建应用程序时我收到错误(请参阅下面的错误日志)我之前尝试过通过使用 -dontwarn 解决此错误,但在我安装 apk 时使用此错误后,应用程序停止运行,我认为从 jar 文件中引用的类中很少有行为不正常或任何可能的原因。有什么有效的解决办法吗?任何帮助将不胜感激。谢谢 !
[2012-11-10 23:52:17 - Nestle-SHSH] Proguard returned with error code 1. See console
[2012-11-10 23:52:17 - Nestle-SHSH] Note: there were 4 duplicate class definitions.
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find superclass or interface java.awt.Graphics2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D$FakeComponent: can't find superclass or interface java.awt.Component
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D$HyperLinkKey: can't find superclass or interface java.awt.RenderingHints$Key
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfPrinterGraphics2D: can't find superclass or interface java.awt.print.PrinterGraphics
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.geom.PolylineShape: can't find superclass or interface java.awt.Shape
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.geom.PolylineShapeIterator: can't find superclass or interface java.awt.geom.PathIterator
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.AsianFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.AsianFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.AsianFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.AsianFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.DefaultFontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.FontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.FontMapper: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.RenderingHints
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.RenderingHints
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Graphics2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Graphics2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.BasicStroke
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.BasicStroke
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.RenderingHints
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.RenderingHints
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Color
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Color
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Area
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Rectangle2D$Float
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Rectangle2D$Float
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Area
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImageOp
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImageOp
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.ColorModel
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.ColorModel
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.BufferedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.RenderedImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.image.renderable.RenderableImage
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Color
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.AffineTransform
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Color
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Color
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Rectangle2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.Font
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Rectangle2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Line2D$Double
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.geom.Line2D$Double
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced method 'java.awt.FontMetrics getFontMetrics()' in class com.itextpdf.awt.PdfGraphics2D
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: com.itextpdf.awt.PdfGraphics2D: can't find referenced class java.awt.FontMetrics
[2012-11-10 23:52:17 - Nestle-SHSH] You must avoid such dependencies, since the program classes will
[2012-11-10 23:52:17 - Nestle-SHSH] be processed, while the library classes will remain unchanged.
[2012-11-10 23:52:17 - Nestle-SHSH] Warning: there were 1 unresolved references to program class members.
[2012-11-10 23:52:17 - Nestle-SHSH] Your input classes appear to be inconsistent.
[2012-11-10 23:52:17 - Nestle-SHSH] You may need to recompile them and try again.
[2012-11-10 23:52:17 - Nestle-SHSH] Alternatively, you may have to specify the option
[2012-11-10 23:52:17 - Nestle-SHSH] '-dontskipnonpubliclibraryclassmembers'.
[2012-11-10 23:52:17 - Nestle-SHSH] java.io.IOException: Please correct the above warnings first.
[2012-11-10 23:52:17 - Nestle-SHSH] at proguard.Initializer.execute(Initializer.java:321)
[2012-11-10 23:52:17 - Nestle-SHSH] at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-11-10 23:52:17 - Nestle-SHSH] at proguard.ProGuard.execute(ProGuard.java:86)
[2012-11-10 23:52:17 - Nestle-SHSH] at proguard.ProGuard.main(ProGuard.java:492)
这是我的 proguard.cfg 文件:-
-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 *;
}