带有外部 jar 的 Proguard 错误 - 返回错误代码 1
Posted
技术标签:
【中文标题】带有外部 jar 的 Proguard 错误 - 返回错误代码 1【英文标题】:Proguard errors with external jar - returns error code 1 【发布时间】:2013-01-08 05:36:19 【问题描述】:在导出我的 android 应用程序时,Proguard 返回错误代码 1。我在我的应用程序中使用 twitter4j 外部 jars。
我已经在 proguard.cfg 文件中添加了库 jars、rt.jar(为此我下载了最新的 jdk1.7,它具有 javax.management.* 类)和 dontwarn 语句。
我还包含了 injars、libraryjars 语句..
更新
-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。
更新 日志猫:
[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)
【问题讨论】:
发布完整的 logcat 消息 感谢您的快速回复。您可以从以下链接中看到完整的 logcat 和 proguard 文件。 host01.fileconvoy.com/… 你的构建路径中有路标吗?当我的构建路径中没有一些罐子时,我曾经遇到过这些错误。编辑 - 其他罐子也有同样的问题 我所有的 jars 都在 /libs 文件夹中。所以,我没有明确地将这些 jar 添加到我的构建路径中。我也尝试通过在配置文件中注释 dontwarn 路标 jar 行,仍然没有成功 【参考方案1】:尝试以这种方式添加发出警告的包:
-dontwarn com.google.code.**
-dontwarn oauth.signpost.**
-dontwarn twitter4j.**
由于某种原因,如果这不起作用,请尝试对类和接口名称执行相同的操作,这样:
-dontwarn javax.management.**
-dontwarn javax.xml.**
-dontwarn org.apache.**
-dontwarn org.slf4j.**
到您的 Proguard 配置文件。
【讨论】:
没有成功,logcat 中仍然显示相同的错误。我还添加了以下带有上述 dontwarn statemets 的错过的库。 -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跨度> 你有同样的 logcat 吗?至少添加这些行后,必须减少警告的数量。请使用最新的配置文件更新问题 非常感谢您的快速回复。相同数量的警告。什么也没有变。我用最新的 proguard 配置文件和 logcat 更新了问题。 @Santhosh 尝试编辑后的答案。 很少有属于 JavaRunTime 但不属于 AndroidRunTime 的类会给出这样的警告。在这种情况下,将引用类添加到dontwarn
标记
我已经将这些 dontwarn 语句添加到我的配置文件中。即使我再次尝试,仍然同样的错误没有成功。【参考方案2】:
非常感谢大家。经过这么多的挣扎,我终于发现了我愚蠢的错误。我在 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 *;
【讨论】:
出于某种原因,我不得不添加 -dontwarn com.google.ads.** 然后答案起作用了。 非常感谢亲爱的发布这个有用的代码片段。它帮了我很多欢呼!!【参考方案3】:鉴于这些-dontwarn
选项,您不会从您的构建中收到这些警告。您应该仔细检查您是否正在编辑正确的配置文件(proguard-project.txt
从 Android SDK r20 开始)。
【讨论】:
感谢您的回复。前几天我的问题已经解决了,你说的是对的。我在proguard配置中犯了错误。无论如何放弃投票......【参考方案4】:我在集成 Proguard 的过程中发现了一些东西,也许对你有帮助。
1>在使用 Google 的许可证验证库时,我们希望防止附加类在附加库中被混淆。为此,我使用了 proguard/config.txt 文件:
**-keep class com.android.vending.licensing.ILicensingService**
2> 在为 MapActivity 使用 Google api 时,我收到了警告:
找不到所有 come.google.android.maps 的引用类 类,和“注意:配置是指未知类 'com.google.android.maps'"`
当我们使用 Google API 时,有一个额外的库用于构建程序。为此我们需要调整路径。
通常只有 android.jar 位于您的 SDK 中。但是 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> 参考:Android Proguard skip external jar
【讨论】:
我没有在我的应用程序中使用 Google 地图、许可和应用内购买服务。无论如何,保持... ILicensingService 也添加到我的配置文件中。 感谢您的回复,我已经浏览了文档,我认为我使用 libraryjar 在我的 proguard 配置文件中添加的所有内容但没有成功。【参考方案5】:尝试将下一行添加到您的 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>;
【讨论】:
也尝试添加上述语句,没有成功【参考方案6】:对我有用的一件事是减少“优化通过次数”尝试 2。
【讨论】:
尝试了 -optimizationpasses 2,没有成功【参考方案7】:我猜Android不支持jdk 1.7,可能是你的问题。 Can the Android SDK work with JDK 1.7?
【讨论】:
我已将我的 ADT 更新为 R21.1.0(developer.android.com/tools/sdk/eclipse-adt.html),它需要 Java 1.6 或更高版本。因此,我将项目编译器合规级别更改为 1.7。但它给予'Android 需要编译器合规级别 5.0 或 6.0。而是找到了“1.7”。我已经检查了一切都很好。你能帮我解决这个问题吗?【参考方案8】:我收到“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 的绝对路径即可解决问题。
【讨论】:
以上是关于带有外部 jar 的 Proguard 错误 - 返回错误代码 1的主要内容,如果未能解决你的问题,请参考以下文章
使用外部 Admob jar 的 Proguard 运行时错误