(安卓)Proguard的找不到动态引用的类的javax.swing。* [英] (Android) Proguard can't find dynamically referenced class javax.swing.*

查看:315
本文介绍了(安卓)Proguard的找不到动态引用的类的javax.swing。*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Proguard的问题,使用的外部库。我的项目编译没有错误,并成功地在真实的设备上运行, 但只有在Eclipse,当我运行它。现在我想打一个模糊的发行版,所以我做了以下内容: 跑了Android的更新项目-p ./ 添加

I have a problem with Proguard and use of external libraries. My project compiles without errors and runs successfully on a real device, but only when I run it from Eclipse. Now I want to make an obfuscated release version so I did the following: ran "android update project -p ./" added

proguard.dir=/home/stoned/android-sdk-linux_86/proguard4.5.1/lib
proguard.config=/home/stoned/workspace/Fidoo/proguard.cfg

当我运行ant发布我得到如下:

when I run "ant release" I get the following:

... skipped many irrelevant messages ...

-obfuscate:
    [mkdir] Created dir: /home/stoned/workspace/Fidoo/bin/proguard
      [jar] Building jar: /home/stoned/workspace/Fidoo/bin/proguard/original.jar
 [proguard] ProGuard, version 4.4
 [proguard] ProGuard is released under the GNU General Public License. The authors of all
 [proguard] programs or plugins that link to it (com.android.ant, ...) therefore
 [proguard] must ensure that these programs carry the GNU General Public License as well.
 [proguard] Reading input...
 [proguard] Reading program jar [/home/stoned/workspace/Fidoo/bin/proguard/original.jar]
 [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/exapi-1.16.jar]
 [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/libthrift.jar]
 [proguard] Reading program jar [/home/stoned/workspace/Fidoo/libs/log4j-1.2.14.jar]
 [proguard] Reading library jar [/home/stoned/android-sdk-linux_86/platforms/android-4/android.jar]
 [proguard] Initializing...
 [proguard] Warning: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryNodeRenderer: can't find superclass or interface javax.swing.tree.DefaultTreeCellRenderer
 [proguard] Warning: org.apache.log4j.lf5.viewer.categoryexplorer.TreeModelAdapter: can't find superclass or interface javax.swing.event.TreeModelListener
 [proguard] Warning: org.apache.log4j.lf5.viewer.LogBrokerMonitor$32: can't find superclass or interface java.awt.event.ActionListener
 [proguard] Warning: org.apache.log4j.lf5.viewer.LogBrokerMonitor$31: can't find superclass or interface java.awt.event.ActionListener

... skipped many lines of similar messages ...

 [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener
 [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener
 [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener
 [proguard] Note: org.apache.log4j.lf5.viewer.categoryexplorer.CategoryAbstractCellEditor: can't find dynamically referenced class javax.swing.event.CellEditorListener
 [proguard] Note: org.apache.log4j.spi.LocationInfo: can't find dynamically referenced class com.ibm.uvm.tools.DebugSupport
 [proguard] Note: there were 5 unresolved dynamic references to classes or interfaces.
 [proguard]       You should check if you need to specify additional program jars.
 [proguard] Warning: there were 1656 unresolved references to classes or interfaces.
 [proguard]          You may need to specify additional library jars (using '-libraryjars'),
 [proguard]          or perhaps the '-dontskipnonpubliclibraryclasses' option.

显然,javax.swing中。不需要在Android应用程序,以及log4j的类类。如何让我的ProGuard不要搜索这些引用的库?

Obviously, javax.swing. classes are not needed in Android application, as well as log4j classes. How do I make proguard not to search for those referenced libraries?

推荐答案

如果没有版本的log4j的不摆动的依赖,如果你不能轻易的罐子在构建过程中添加一个过滤器,最干净的解决方案是关掉的proguard.cfg只是这些特定的警告:

If there is no version of log4j without the Swing dependencies, and if you can't easily add a filter on the jar in the build process, the cleanest solution is to switch off just these particular warnings in proguard.cfg:

-dontwarn org.apache.log4j.lf5.viewer.**
-dontnote org.apache.log4j.lf5.viewer.**

您会之后,还获得可能相关的其他任何警告。

You'll then still get any other warnings that might be relevant.

这篇关于(安卓)Proguard的找不到动态引用的类的javax.swing。*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆