gpt4 book ai didi

android - (Android) Proguard 找不到动态引用的类 javax.swing.*

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:19:32 25 4
gpt4 key购买 nike

我对 Proguard 和外部库的使用有疑问。我的项目编译没有错误,并在真实设备上成功运行,但只有当我从 Eclipse 运行它时。现在我想制作一个混淆的发布版本,所以我做了以下事情:运行“android 更新项目-p ./”添加了

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

当我运行“ant release”时,我得到以下信息:

... 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 不搜索那些引用的库?

最佳答案

如果没有没有 Swing 依赖项的 log4j 版本,并且如果您不能在构建过程中轻松地在 jar 上添加过滤器,最干净的解决方案是关闭 proguard.cfg 中的这些特定警告:

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

然后您仍会收到任何其他可能相关的警告。

关于android - (Android) Proguard 找不到动态引用的类 javax.swing.*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4525661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com