【问题标题】:Proguard removing classes of log4jProguard 删除 log4j 的类
【发布时间】:2016-10-11 00:30:04
【问题描述】:

我正在尝试生成发布变体 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 删除上述类?

【问题讨论】:

    标签: android log4j apk proguard release


    【解决方案1】:

    在你的 progruard-rules.pro 中添加这个

    -保持类 org.apache.log4j.** { *; }

    *; 表示将所有内容保留在类中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-23
      • 1970-01-01
      • 1970-01-01
      • 2015-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多