外部jar的Proguard错误 - 返回错误代码1

时间:2013-01-24 12:48:55

标签: android proguard

导出我的Android应用程序时,Proguard返回错误代码1.我在我的应用程序中使用twitter4j外部jar。

我已经添加了库jar,rt.jar(为此我下载了最新的jdk1.7,它有javax.management。*类),并且dontwarn语句也发送到proguard.cfg文件。

我还包括了伤害,图书馆的声明......

更新

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-dontshrink
-verbose

#-injars bin/classes
#-injars libs
#-outjars bin/classes-processed.jar

-libraryjars <java.home>/jre/lib/rt.jar
-libraryjars <java.home>/lib/tools.jar
-libraryjars /libs/twitter4j-core-3.0.3.jar
-libraryjars /libs/twitter4j-media-support-3.0.3.jar
-libraryjars /libs/linkedin-j-android.jar
-libraryjars /libs/signpost-commonshttp4-1.2.jar
-libraryjars /libs/signpost-core-1.2.1.1.jar
-libraryjars /libs/signpost-jetty6-1.2.1.1.jar

-dontwarn org.apache.**
-dontwarn org.slf4j.**
-dontwarn org.json.*
-dontwarn org.mortbay.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.codec.binary.**
-dontwarn javax.xml.**
-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn android.support.**
-dontwarn com.google.code.**
-dontwarn oauth.signpost.**
-dontwarn twitter4j.**

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keep class javax.**  { *; }
-keep class org.**  { *; }
-keep class twitter4j.**  { *; }
-keep class java.lang.management.**  { *; }
-keep class com.google.code.**  { *; }
-keep class oauth.signpost.**  { *; }

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

我仍面临这个问题,Proguard返回错误代码1。

更新 logcat的:

[2013-02-18 10:43:47 - SP] Proguard returned with error code 1. See console
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter1: can't find superclass or interface javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find superclass or interface javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find superclass or interface javax.management.DynamicMBean
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter1: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter1: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter1: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.DatatypeConverter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.DatatypeConverter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.DatatypeConverter
[2013-02-18 10:43:47 - SP] Warning: com.google.code.linkedinapi.schema.Adapter2: can't find referenced class javax.xml.bind.annotation.adapters.XmlAdapter
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.commonshttp.CommonsHttpOAuthProvider: can't find referenced method 'java.util.Map decodeForm(java.io.InputStream)' in class oauth.signpost.OAuth
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.commonshttp.CommonsHttpOAuthProvider: can't find referenced method 'void setResponseParameters(java.util.Map)' in class oauth.signpost.commonshttp.CommonsHttpOAuthProvider
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.jetty.JettyOAuthConsumer: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-02-18 10:43:47 - SP] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class java.lang.management.ManagementFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class java.lang.management.ManagementFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenDataException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanAttributeInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanConstructorInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanOperationInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.MBeanNotificationInfo
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.SimpleType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanAttributeInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanParameterInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanConstructorInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.SimpleType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanOperationInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeNotFoundException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeNotFoundException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.Attribute
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.Attribute
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.ReflectionException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.ReflectionException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.SimpleType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.DynamicMBean
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.MBeanException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.InvalidAttributeValueException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.SimpleType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularType
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenDataException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.MBeanInfo
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanAttributeInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanConstructorInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanOperationInfoSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.MBeanNotificationInfo
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenMBeanParameterInfo
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeData
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.OpenDataException
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.TabularDataSupport
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.Attribute
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.Attribute
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.AttributeList
[2013-02-18 10:43:47 - SP]       You should check if you need to specify additional program jars.
[2013-02-18 10:43:47 - SP] Warning: there were 160 unresolved references to classes or interfaces.
[2013-02-18 10:43:47 - SP]          You may need to specify additional library jars (using '-libraryjars').
[2013-02-18 10:43:47 - SP] Warning: there were 2 unresolved references to program class members.
[2013-02-18 10:43:47 - SP]          Your input classes appear to be inconsistent.
[2013-02-18 10:43:47 - SP]          You may need to recompile them and try again.
[2013-02-18 10:43:47 - SP]          Alternatively, you may have to specify the option 
[2013-02-18 10:43:47 - SP]          '-dontskipnonpubliclibraryclassmembers'.
[2013-02-18 10:43:47 - SP] java.io.IOException: Please correct the above warnings first.
[2013-02-18 10:43:47 - SP]  at proguard.Initializer.execute(Initializer.java:321)
[2013-02-18 10:43:47 - SP]  at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-02-18 10:43:47 - SP]  at proguard.ProGuard.execute(ProGuard.java:86)
[2013-02-18 10:43:47 - SP]  at proguard.ProGuard.main(ProGuard.java:492)

8 个答案:

答案 0 :(得分:15)

尝试添加以下方式发出警告的包:

-dontwarn com.google.code.**
-dontwarn oauth.signpost.**
-dontwarn twitter4j.**

出于某种原因,如果这不起作用,请尝试对类和接口名称执行相同操作,这样:

-dontwarn javax.management.**
-dontwarn javax.xml.**
-dontwarn org.apache.**
-dontwarn org.slf4j.**

Proguard配置文件

答案 1 :(得分:10)

非常感谢你们。经过这么多的挣扎,我发现了我的愚蠢错误。我在project.properties中配置了错误的配置文件。

我正在更改proguard.cfg中的代码,但project.properties文件包含错误的配置文件路径,即

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

修正了此更改:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard.cfg

proguard.cfg工作版

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-dontshrink
-verbose

-injars bin/classes
-injars libs
-outjars bin/classes-processed.jar

-libraryjars C:/glassfish3/jdk7/jre/lib/rt.jar 
-libraryjars C:/glassfish3/jdk7/lib/tools.jar

-dontwarn org.apache.**
-dontwarn org.slf4j.**
-dontwarn org.json.*
-dontwarn org.mortbay.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.codec.binary.**
-dontwarn javax.xml.**
-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn android.support.**
-dontwarn com.google.code.**
-dontwarn oauth.signpost.**
-dontwarn twitter4j.**

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keep public class com.google.code.linkedinapi.**

-keep class javax.**  { *; }
-keep class org.**  { *; }
-keep class twitter4j.**  { *; }
-keep class java.lang.management.**  { *; }
-keep class com.google.code.**  { *; }
-keep class oauth.signpost.**  { *; }

-keepclassmembers public class com.google.code.linkedinapi.client.impl.LinkedInApiXppClient {
     public <init>(java.lang.String, java.lang.String);
}

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

答案 2 :(得分:3)

鉴于这些-dontwarn选项,您无法从构建中获取这些警告。您应该仔细检查您是否正在编辑正确的配置文件(从Android SDK r20开始为proguard-project.txt)。

答案 3 :(得分:1)

我在整合Proguard时找到了一些东西,也许对你有帮助。

1&gt;在使用Google的许可证验证库时,我们希望在附加库中保留其他类,使其不被混淆。因为我使用了proguard / config.txt文件:

**-keep class com.android.vending.licensing.ILicensingService**

2 - ; 在使用Google api进行MapActivity时,我收到了警告:

  

无法找到所有come.google.android.maps的引用类   类,和“注意:配置是指未知类   'com.google.android.maps'“`

当我们使用Google API时,还有一个用于构建程序的附加库。为此,我们需要调整路径。

通常情况下,SDK中只有android.jar。但Google API添加了另一个图书馆maps.jar,隐藏在android-sdk-windows \ add-ons \ addon_google_apis_google_inc_8 \ libs \ maps.jar中。我们需要将它添加到build.xml文件中。在build.xml中找到优化目标,并通过调整路径将以下文本以粗体添加到proguard命令:

<arg value="-libraryjars ${android.jar}"/>
<arg value="-libraryjars ${sdk.dir}/add-ons\addon_google_apis_google_inc_8\libs\maps.jar"/>

看看这个参考:http://goo.gl/Ifgyj

3&GT;参考:Android Proguard skip external jar

答案 4 :(得分:1)

尝试将下一行添加到proguard文件中:

  -keep public class com.google.code.linkedinapi.**

  -keepclassmembers public class com.google.code.linkedinapi.client.impl.LinkedInApiXppClient {
     public <init>(java.lang.String, java.lang.String);
   }

并添加

-keep class twitter4j.**
-keepclassmembers class twitter4j.** {
    <init>(...);
    <methods>;
    <fields>;
}

也是添加

的好主意
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}
-keepclassmembers class **.R$* {
    public static <fields>;
}

答案 5 :(得分:0)

对我有用的一件事是减少&#34;优化通道&#34;试试2。

答案 6 :(得分:0)

我猜Android不支持jdk 1.7,可能这是你的问题。 Can the Android SDK work with JDK 1.7?

答案 7 :(得分:0)

我收到了“Proguard返回错误代码1.请参阅控制台”错误。在我的情况下,问题出在ADT用来启动ProGuard的“sdk \ tools \ proguard \ bin \ proguard.bat”文件中。它包含行“java -jar”%PROGUARD_HOME%“\ lib \ proguard.jar%*”。在我的环境中,简单的命令“java”不起作用。我从不使用它,因为我在不同的情况下指定了特定的JVM。

无论如何,将“java”改为JDK 1.7 bin \ java.exe的绝对路径解决了这个问题。