2011-06-25 4 views
1

Lorsque j'abandonne proguard pour android, le proguard va masquer tous les pots inclus dans l'application. Ces pots comprennent:java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory

  • libraryjars lib/Analytics_Android_SDK_2.1.jar
  • libraryjars lib/commons-codec.jar
  • libraryjars lib/commons-httpclient-3.1.jar
  • libraryjars lib/Communes- journalisation 1.1.jar
  • libraryjars lib/weibo.jar
  • libraryjars lib/poteau indicateur-core-1.2.1.1.jar
  • libraryjars lib/poteau-commonshttp4-1.2.1.1.jar
  • libraryjars lib/youmibannerad-android.jar

tout en construisant le pot signé, je reçois la décharge suivante:

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 

En fait, ce projet est sur le point sina SDK Weibo, lorsque j'utilise proguard à obscurcir, je manquai pas toujours, avec l'erreur ci-dessous:

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) 

alors j'ai ajouté le code -ignorewarnings en pro garde fichier de configuration, de sorte que les avertissements tous rejetés, mais quand je lance l'application, les erreurs que dans le titre se produira.

+0

S'il vous plaît donner un titre significatif. –

Répondre

0

Je voudrais essayer commons-logging-1.1.1. Il semble y avoir une incompatibilité de version

+0

Merci pour votre réponse, je l'ai essayé, c'est toujours cette erreur. –

+0

mais avez-vous retiré l'ancien? – Bozho

3

Ran dans le même problème sur un projet externalisé où il semble que les développeurs ont utilisé toutes les bibliothèques libres possibles dans le monde.

L'approche la plus sûre est de fournir ProGuard avec les bibliothèques d'origine comme référence, même si certains d'entre eux sont désapprouvées et ne sera probablement jamais appelé par votre code:

Log4J - http://logging.apache.org/log4j/1.2/download.html

Avalon - http://www.docjar.com/jar_detail/avalon-framework-4.2.0.jar.html

Avalon logkit - http://www.jarfinder.com/index.php/jars/versionInfo/17610

référence J2EE - http://www.jarfinder.com/index.php/jars/versionInfo/4598

Une fois que vous téléchargez tous les pots, le point ProGuard les:

# 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 

Profitez

Questions connexes