- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
当我为 android 启用 proguard 时,proguard 将混淆应用程序中包含的所有 jar。这些 jar 包括:
在构建签名的 jar 时,我得到以下转储:
06-25 16:07:25.094: WARN/dalvikvm(13785): Exception Ljava/lang/NoSuchMethodError; own while initializing Lorg/apache/commons/httpclient/HttpMethodBase;
06-25 16:07:25.094: WARN/dalvikvm(13785): threadid=14: thread exiting with uncaught exception (group=0x40015560)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): FATAL EXCEPTION: Thread-18
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): java.lang.ExceptionInInitializerError
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): at weibo4andriod.http.HttpClient.a(Unknown Source)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): at weibo4andriod.Weibo.a(Unknown
Source)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): at com.snda.childbook.UpdateStatusThread.run(Unknown Source)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): at java.lang.Thread.run(Thread.java:1019)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): Caused by: java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory.c
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): at org.apache.commons.httpclient.HttpMethodBase.<clinit>(Unknown Source)
06-25 16:07:25.104: ERROR/AndroidRuntime(13785): ... 4 more
06-25 16:07:25.104: WARN/ActivityManager(104): Force finishing activity com.snda.childbook/.BookReader
其实这个项目是关于新浪微博SDK的,我用proguard混淆的时候总是失败,错误如下:
testpostmethord] Proguard returned with error code 1. See console
[2011-06-27 15:31:11 - testpostmethord] Note: there were 1 duplicate class definitions.
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find superclass or interface javax.servlet.ServletContextListener
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.AvalonLogger: can't find referenced class org.apache.avalon.framework.logger.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Category
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Priority
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Hierarchy
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Hierarchy
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Hierarchy
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.LogKitLogger: can't find referenced class org.apache.log.Logger
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find referenced class javax.servlet.ServletContextListener
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find referenced class javax.servlet.ServletContextEvent
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find referenced class javax.servlet.ServletContextEvent
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find referenced class javax.servlet.ServletContextEvent
[2011-06-27 15:31:11 - testpostmethord] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find referenced class javax.servlet.ServletContextEvent
[2011-06-27 15:31:11 - testpostmethord] You should check if you need to specify additional program jars.
[2011-06-27 15:31:11 - testpostmethord] Warning: there were 70 unresolved references to classes or interfaces.
[2011-06-27 15:31:11 - testpostmethord] You may need to specify additional library jars (using '-libraryjars').
[2011-06-27 15:31:11 - testpostmethord] java.io.IOException: Please correct the above warnings first.
[2011-06-27 15:31:11 - testpostmethord] at proguard.Initializer.execute(Initializer.java:321)
[2011-06-27 15:31:11 - testpostmethord] at proguard.ProGuard.initialize(ProGuard.java:211)
[2011-06-27 15:31:11 - testpostmethord] at proguard.ProGuard.execute(ProGuard.java:86)
[2011-06-27 15:31:11 - testpostmethord] at proguard.ProGuard.main(ProGuard.java:492)
所以我将代码 -ignorewarnings 添加到 proguard 配置文件中,所以警告都消失了,但是当我运行应用程序时,标题中的错误会发生。
最佳答案
在一个外包项目中遇到了同样的问题,开发人员似乎已经使用了世界上所有可能的免费库。
最安全的方法是向 ProGuard 提供原始库作为引用,即使其中一些已被弃用并且可能永远不会被您的代码调用:
Log4J - http://logging.apache.org/log4j/1.2/download.html
阿瓦隆 - http://www.docjar.com/jar_detail/avalon-framework-4.2.0.jar.html
阿瓦隆 LogKit - http://www.jarfinder.com/index.php/jars/versionInfo/17610
J2EE 引用 - http://www.jarfinder.com/index.php/jars/versionInfo/4598
下载所有 jar 后,将 ProGuard 指向它们:
# Apache commomns-logging fun
-libraryjars proguard_ref_lib/log4j-1.2.17.jar
-libraryjars proguard_ref_lib/avalon-framework-4.2.0.jar
-libraryjars proguard_ref_lib/avalon-logkit-2.2.1.jar
-libraryjars proguard_ref_lib/servlet-api-6.0.16.jar
# Apache commomns-logging fun ends
享受
关于java.lang.NoSuchMethodError : org. apache.commons.logging.LogFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6476847/
下面的代码片段是否有可能将错误记录到数据库或文本文件中?我知道它可以写入 Eclipse 控制台。我是一名 .NET 开发人员,所以我不太确定。 private final static Log lo
我正在尝试在 Maven/Spring 项目上运行 JUnit 并使用 Web 服务客户端 (axis2) 进行测试。 这是有问题的 Web 服务客户端调用: ProServiceLocator lo
我仍在解决 Java 中 Http Builder 的问题。构建器正在使用私有(private)日志。该日志是使用 Logger Factory 生成的。在调试时,我注意到记录器级别为空,因此不会打印
我正在将一些 Java 代码迁移到 Android。代码库包含相当多的 LogFactory.getLog(xxx)。 LogFactory来自org.apache.commons.logging.L
尝试启动 tomcat7 时出现此错误: Buildfile: E:\Workspace\test\config\deploy\build.xml tomcat.start: [java]
我正在使用最新的 STS,刚刚更新:\版本:2.9.0.RELEASE内部版本号:201203011000 我已经将 spring-framework-3.1.1.RELEASE 下载到一个目录中。我
我是 JasperReports 的新手,我想将 JasperReports 集成到我的 Java 程序中,所以当我点击打印按钮时,程序会显示报告。但是当我点击按钮时,我得到了一个NoClassDef
在部署 dwr Web 应用程序时,我不断收到此错误。 我不知道为什么会这样。我无法运行我的任何 DWR 示例项目。 除此之外,我们得到这个 ClassNotFound 错误。这里有什么概念? 这是一
当我在 Glassfish 4.1 服务器上运行我的 rest api 点时,我面临以下 NoClassDefFoundError,即使我将耳朵与 commons-logging 作为依赖项一起发送,
我正在使用 My-eclipse 并做一个 struts 项目,没有语法错误,但在启动 tomcat 服务器时,控制台中出现以下错误。 java.lang.ClassNotFoundException
我得到下一个错误: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogF
当我使用最新的 tcsever 2.9.2 时,出现此错误。 错误 | wrapper | 2014/01/21 19:06:47 | JVM 在加载应用程序时退出。 信息 |虚拟机 4 | 2014
当我启动我的 Web 应用程序时,我收到 java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory。 正如您在下图中看到
当我运行应用程序时出现异常 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/
当我为 android 启用 proguard 时,proguard 将混淆应用程序中包含的所有 jar。这些 jar 包括: libraryjars lib/Analytics_Android_SD
我有一个使用 Spring 运行 json Web 服务的 Maven 项目。该项目在 NetBeans 中运行良好。它被编译成 jar 文件,并且 jar 文件在 Ubuntu VM 中运行良好。但
我使用 cygwin 在 Windows 中安装 Hadoop-0.20.2。如果我跑 $ bin/hadoop version Hadoop 0.20.2 Subversion https://s
错误: E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.azail.cart.debug, PID: 2403
我可以知道使用 org.apache.commons.logging.LogFactory.getLog 的最佳实践是什么吗? 对我来说,我按以下方式使用它: public class A {
我知道这是包的区别 1) org.apache.log4j.Logger logger = Logger.getLogger(clazz); 2) org.apache.commons.logging
我是一名优秀的程序员,十分优秀!