Proguard删除了log4j的类

时间:2016-10-11 00:30:04

标签: android log4j apk proguard release

我正在尝试生成版本变体APK并继续收到这些错误:

Super class java.awt.event.KeyAdapter of org.apache.log4j.lf5.viewer.LogFactor5InputDialog$1 is missing from classpath.
Super class java.awt.event.MouseAdapter of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$2 is missing from classpath.
Super class java.awt.event.WindowAdapter of org.apache.log4j.chainsaw.Main$1 is missing from classpath.
Super class java.awt.event.WindowAdapter of org.apache.log4j.lf5.viewer.LogBrokerMonitor$LogBrokerMonitorWindowAdaptor is missing from classpath.
Super class javax.mail.Authenticator of org.apache.log4j.net.SMTPAppender$1 is missing from classpath.
Super class javax.swing.AbstractAction of org.apache.log4j.chainsaw.ExitAction is missing from classpath.
Super class javax.swing.AbstractAction of org.apache.log4j.chainsaw.LoadXMLAction is missing from classpath.
Super class javax.swing.JDialog of org.apache.log4j.lf5.viewer.LogFactor5Dialog is missing from classpath.
Super class javax.swing.JFrame of org.apache.log4j.chainsaw.Main is missing from classpath.
Super class javax.swing.JPanel of org.apache.log4j.chainsaw.ControlPanel is missing from classpath.
Super class javax.swing.JPanel of org.apache.log4j.chainsaw.DetailPanel is missing from classpath.
Super class javax.swing.JTable of org.apache.log4j.lf5.viewer.LogTable is missing from classpath.
Super class javax.swing.JTree of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryExplorerTree is missing from classpath.
Super class javax.swing.table.AbstractTableModel of org.apache.log4j.chainsaw.MyTableModel is missing from classpath.
Super class javax.swing.table.AbstractTableModel of org.apache.log4j.lf5.viewer.FilteredLogTableModel is missing from classpath.
Super class javax.swing.table.DefaultTableCellRenderer of org.apache.log4j.lf5.viewer.LogTableRowRenderer is missing from classpath.
Super class javax.swing.table.DefaultTableModel of org.apache.log4j.lf5.viewer.LogTableModel is missing from classpath.
Super class javax.swing.tree.DefaultMutableTreeNode of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNode is missing from classpath.
Super class javax.swing.tree.DefaultTreeCellEditor of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryImmediateEditor is missing from classpath.
Super class javax.swing.tree.DefaultTreeCellRenderer of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeRenderer is missing from classpath.
Super class javax.swing.tree.DefaultTreeModel of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryExplorerModel is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.chainsaw.ControlPanel$1 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.chainsaw.ControlPanel$6 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.chainsaw.ControlPanel$7 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$1 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$3 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$4 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$5 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$6 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$7 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeEditor$8 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$10 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$11 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$12 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$13 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$14 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$15 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$16 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$17 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$18 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$19 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$20 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$21 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$22 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$23 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$24 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$25 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$26 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$27 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$28 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$29 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$30 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$31 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$32 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$7 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$8 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogBrokerMonitor$9 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogFactor5ErrorDialog$1 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogFactor5InputDialog$2 is missing from classpath.
Super interface java.awt.event.ActionListener of org.apache.log4j.lf5.viewer.LogFactor5InputDialog$3 is missing from classpath.
Super interface java.awt.event.AdjustmentListener of org.apache.log4j.lf5.viewer.TrackingAdjustmentListener is missing from classpath.
Super interface javax.jms.MessageListener of org.apache.log4j.net.JMSSink is missing from classpath.
Super interface javax.management.DynamicMBean of org.apache.log4j.jmx.AbstractDynamicMBean is missing from classpath.
Super interface javax.management.MBeanRegistration of org.apache.log4j.jmx.AbstractDynamicMBean is missing from classpath.
Super interface javax.management.NotificationBroadcaster of org.apache.log4j.jmx.HierarchyDynamicMBean is missing from classpath.
Super interface javax.management.NotificationListener of org.apache.log4j.jmx.LoggerDynamicMBean is missing from classpath.
Super interface javax.swing.event.DocumentListener of org.apache.log4j.chainsaw.ControlPanel$2 is missing from classpath.
Super interface javax.swing.event.DocumentListener of org.apache.log4j.chainsaw.ControlPanel$3 is missing from classpath.
Super interface javax.swing.event.DocumentListener of org.apache.log4j.chainsaw.ControlPanel$4 is missing from classpath.
Super interface javax.swing.event.DocumentListener of org.apache.log4j.chainsaw.ControlPanel$5 is missing from classpath.
Super interface javax.swing.event.ListSelectionListener of org.apache.log4j.chainsaw.DetailPanel is missing from classpath.
Super interface javax.swing.event.ListSelectionListener of org.apache.log4j.lf5.viewer.LogTable$LogTableListSelectionListener is missing from classpath.
Super interface javax.swing.event.TreeModelListener of org.apache.log4j.lf5.viewer.categoryexplorer.TreeModelAdapter is missing from classpath.
Super interface javax.swing.table.TableCellEditor of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor is missing from classpath.
Super interface javax.swing.tree.TreeCellEditor of org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor is missing from classpath.

我假设我可以检查它是与ProGuard删除类相关的问题。可能是这个问题的库是jexcelapi

我对ProGuard还不是很熟悉,但我知道可以排除删除特定的类。如何防止ProGuard删除上述类?

1 个答案:

答案 0 :(得分:0)

在progruard-rules.pro中添加此内容

-keep class org.apache.log4j。** {*; }

*;意味着将所有内容保留在课堂内。