fixing android proguard - android

This is the console output:
[2012-11-27 21:37:04 - com.generalquiz.SplashActivity] Proguard returned with error code 1. See console
[2012-11-27 21:37:04 - com.generalquiz.SplashActivity]
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Proguard returned with error code 1. See console
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find superclass or interface com.paypal.android.MEP.PayPalResultDelegate
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.DataProxy: can't find superclass or interface java.awt.datatransfer.Transferable
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.NativeClipboard: can't find superclass or interface java.awt.datatransfer.Clipboard
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.Sasl
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] at proguard.Initializer.execute(Initializer.java:321)
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.execute(ProGuard.java:86)
[2012-11-27 21:40:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.main(ProGuard.java:492)
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Proguard returned with error code 1. See console
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find superclass or interface com.paypal.android.MEP.PayPalResultDelegate
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.DataProxy: can't find superclass or interface java.awt.datatransfer.Transferable
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.NativeClipboard: can't find superclass or interface java.awt.datatransfer.Clipboard
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.fortumo.FortumoPaymentProvider$1: can't find referenced class com.fortumo.android.Fortumo
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.fortumo.FortumoPaymentProvider$1: can't find referenced class com.fortumo.android.Fortumo
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.fortumo.FortumoPaymentProviderController: can't find referenced class com.fortumo.android.FortumoActivity
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalResultDelegate
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController: can't find referenced class com.paypal.android.MEP.PayPalPayment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.scoreloop.client.android.core.paymentprovider.paypalx.PayPalXPaymentProviderController$1: can't find referenced class com.paypal.android.MEP.PayPal
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.Sasl
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.Sasl
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.SystemFlavorMap
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.DataFlavor
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] You should check if you need to specify additional program jars.
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] Warning: there were 268 unresolved references to classes or interfaces.
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] You may need to specify additional library jars (using '-libraryjars').
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] java.io.IOException: Please correct the above warnings first.
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] at proguard.Initializer.execute(Initializer.java:321)
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.execute(ProGuard.java:86)
[2012-11-27 21:44:45 - com.generalquiz.SplashActivity] at proguard.ProGuard.main(ProGuard.java:492)
And my proguard.cfg :
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-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
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keep class com.scoreloop.client.android.core.** { *; }
-keep class com.facebook.android.** { *; }
I searched about proguard but it's not clear for me how to fix this. and what i should write in the proguard.cfg and if i ignered any class means it won't obfuscate the code?

You may add in your configuration:
-dontwarn com.sun.mail.imap.protocol.**
-dontwarn com.scoreloop.client.android.core.paymentprovider.paypalx.**
...

To disable obfuscation completely, add
-dontobfuscate
If you prefer to have obfuscation I think you need to mark the classes it can't find at runtime with -keep
Here is a good resource I've used in the past: http://proguard.sourceforge.net/index.html#/manual/optimizations.html

Related

android -progaurd keeps erroring with parse

This is my proguard rules :
-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-keepclasseswithmembernames class * {
native <methods>;
}
i've searched and used lots of codes but none of them worked . these are the errors I got :
Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or interface com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionDefaultAudience
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
You should check if you need to specify additional program jars.
please do not tell me to use dontwarn ,yes it manage to build the app but the app will not be run
How can I solve this problem ?
You have to use this
-keep class com.parse.** { *; }
i.e. ** instead of *
and maybe this too
-keepattributes *Annotation*
Please try to use below in your progaurd file :
#Parse
-keep class com.parse.** { *; }
-keepattributes Signature
Hope It will help.!!

android -Progaurd return error 1

I want to use proguard for my application , I'm using eclipse . This is the config file :
-dontwarn com.parse.**
-keep class com.facebook.** {
*;
}
-keepattributes Signature
#When not preverifing in a case-insensitive filing system, such as Windows. This tool will unpack your processed jars,(if using windows you should then use):
-dontusemixedcaseclassnames
#Specifies not to ignore non-public library classes. As of version 4.5, this is the default setting
-dontskipnonpubliclibraryclasses
# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
-dontwarn android.support.**
#Specifies to write out some more information during processing. If the program terminates with an exception, this option will print out the entire stack trace, instead of just the exception message.
-verbose
#The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. Note that the Dalvik VM also can't handle aggressive overloading (of static fields).
#To understand or change this check http://proguard.sourceforge.net/index.html#/manual/optimizations.html
#-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.
#To repackage classes on a single package
#-repackageclasses ''
#Uncomment if using annotations to keep them.
#-keepattributes *Annotation*
#Keep classes that are referenced on the AndroidManifest
-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.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
#Compatibility library
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment
#To maintain custom components names that are used on layouts XML.
#Uncomment if having any problem with the approach below
#-keep public class custom.components.package.and.name.**
# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
#To remove debug logs:
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** w(...);
}
#To avoid changing names of methods invoked on layout's onClick.
# Uncomment and add specific method names if using onClick on layouts
#-keepclassmembers class * {
# public void onClickButton(android.view.View);
#}
#Maintain java native methods
-keepclasseswithmembernames class * {
native <methods>;
}
#To maintain custom components names that are used on layouts XML:
-keep public class * extends android.view.View {
public <init>(android.content.Context);
}
-keep public class * extends android.view.View {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keep public class * extends android.view.View {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
#Maintain enums
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
#To keep parcelable classes (to serialize - deserialize objects to sent through Intents)
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
#Keep the R
-keepclassmembers class **.R$* {
public static <fields>;
}
When I export the application and build the apk file ,it gives me the "Progaurd return error 1" and the in the consul it returns these errors :
Proguard returned with error code 1. See console
Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or interface com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionDefaultAudience
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook$ServiceListener
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session$StatusCallback
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request$Callback
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
You should check if you need to specify additional program jars.
Warning: there were 82 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars').
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
at proguard.ProGuard.execute(ProGuard.java:86)
at proguard.ProGuard.main(ProGuard.java:492)
There are some external libraries that I use in my application , I just need the progaurd for obfuscation
Could you help me to solve this problem ?
Replace
-keep class com.facebook.** {
*;
}
with,
-dontwarn com.facebook.**

Error in Jackson.jar when running proguard in android

I have an android project that uses jackson-all-1.7.2.jar.
When I run a proguard with this proguard.cfg file:
-keep class com.actionbarsherlock.** {*;}
-keep class org.holoeverywhere.** {*;}
-libraryjars /libs/jackson-all-1.7.2.jar
I got this exception:
[2013-06-15 06:06:04 - ArrowAndroid] Proguard returned with error code 1. See console
[2013-06-15 06:06:04 - ArrowAndroid] Note: there were 600 duplicate class definitions.
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find superclass or interface javax.ws.rs.ext.MessageBodyReader
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find superclass or interface javax.ws.rs.ext.MessageBodyWriter
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JsonMappingExceptionMapper: can't find superclass or interface javax.ws.rs.ext.ExceptionMapper
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JsonParseExceptionMapper: can't find superclass or interface javax.ws.rs.ext.ExceptionMapper
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.xc.DataHandlerJsonDeserializer$1: can't find superclass or interface javax.activation.DataSource
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider: can't find referenced class javax.ws.rs.ext.Provider
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider: can't find referenced class javax.ws.rs.Consumes
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider: can't find referenced class javax.ws.rs.Produces
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.core.MediaType
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.ext.Providers
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.ext.ContextResolver
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.core.StreamingOutput
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.core.Response
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.ext.MessageBodyReader
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.ext.MessageBodyWriter
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.core.MediaType
[2013-06-15 06:06:04 - ArrowAndroid] Warning: org.codehaus.jackson.jaxrs.JacksonJsonProvider: can't find referenced class javax.ws.rs.ext.Providers
.....
.....
.....
[2013-06-15 06:06:04 - ArrowAndroid] You should check if you need to specify additional program jars.
[2013-06-15 06:06:04 - ArrowAndroid] Warning: there were 387 unresolved references to classes or interfaces.
[2013-06-15 06:06:04 - ArrowAndroid] You may need to specify additional library jars (using '-libraryjars').
[2013-06-15 06:06:04 - ArrowAndroid] java.io.IOException: Please correct the above warnings first.
[2013-06-15 06:06:04 - ArrowAndroid] at proguard.Initializer.execute(Initializer.java:321)
[2013-06-15 06:06:04 - ArrowAndroid] at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-06-15 06:06:04 - ArrowAndroid] at proguard.ProGuard.execute(ProGuard.java:86)
[2013-06-15 06:06:04 - ArrowAndroid] at proguard.ProGuard.main(ProGuard.java:492)
Note, the app running perfectly without proguard.
When I add the following line in proguard.cfg
-dontwarn org.codehaus.jackson
The app crashes reporting this exception:
Caused by: java.lang.ExceptionInInitializerError
at org.codehaus.jackson.map.ObjectMapper.<clinit>(Unknown Source)
... 15 more
Caused by: java.lang.NoSuchFieldError: PUBLIC_ONLY
at java.lang.Class.getDeclaredAnnotation(Native Method)
at java.lang.Class.getAnnotation(Class.java:260)
at org.codehaus.jackson.map.introspect.VisibilityChecker$Std.<clinit>(Unknown Source)
... 16 more
The file jackson-all-1.7.2.jar is already in your libs directory, so the Android Ant/Eclipse builds will pick it up automatically. You shouldn't read it again with -libraryjars, because then you'll get these warnings about duplicates.
Jackson is using reflection to find some annotations. ProGuard can't deduce this automatically, and it ends up removing related, seemingly unused fields. This configuration should keep them:
-keepclassmembers public final enum org.codehaus.jackson.annotate.JsonAutoDetect$Visibility {
public static final org.codehaus.jackson.annotate.JsonAutoDetect$Visibility *;
}
Add these line in your proguard configuration file.
-keepnames class com.fasterxml.jackson.** {
*;
}
-keepnames interface com.fasterxml.jackson.** {
*;
}

android proguard causes apk to crash

My app works fine in debug and also when I export to a signed apk if I have proguard disabled by commenting out "proguard.config=${sdk.dir}/tools/proguard..." in project.properties.
However, if I uncomment that line I get a bunch of warnings and proguard won't create the apk. I can suppress the warnings by adding the following lines to proguard-project.txt
-dontwarn com.sun.mail.imap.protocol.**
-dontwarn org.apache.harmony.awt.**
-dontwarn javax.activation.**
and the apk will get created but it will not execute in the phone. Interestingly, if I remove these lines and use "-dontshrink" I continue to get these errors. I would have thought that would get rid of the problem.
I found in http://developer.android.com/tools/help/proguard.html that I am probably missing some -keep lines in my configuration but it is not obvious what these would be. Can anyone provide a clue?
The default proguard.cfg file tries to cover general cases, but you
might encounter exceptions such as ClassNotFoundException, which
happens when ProGuard strips away an entire class that your
application calls.
You can fix errors when ProGuard strips away your code by adding a
-keep line in the proguard.cfg file. For example:
-keep public class
[2013-06-19 14:19:30 - Flashum2] Proguard returned with error code 1. See console
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.DataProxy: can't find superclass or interface java.awt.datatransfer.Transferable
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.NativeClipboard: can't find superclass or interface java.awt.datatransfer.Clipboard
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.Sasl
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.Sasl
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslClient
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator: can't find referenced class javax.security.sasl.SaslException
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.auth.callback.NameCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmCallback
[2013-06-19 14:19:30 - Flashum2] Warning: com.sun.mail.imap.protocol.IMAPSaslAuthenticator$1: can't find referenced class javax.security.sasl.RealmChoiceCallback
[2013-06-19 14:19:30 - Flashum2] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2013-06-19 14:19:30 - Flashum2] Warning: javax.activation.CommandInfo: can't find referenced class java.beans.Beans
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.Toolkit
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.ContextStorage: can't find referenced class java.awt.GraphicsEnvironment
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.DTK: can't find referenced class java.awt.datatransfer.DataFlavor
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.DTK: can't find referenced class java.awt.datatransfer.DataFlavor
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.DTK: can't find referenced class java.awt.datatransfer.DataFlavor
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.DTK: can't
.
.
.
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.SystemFlavorMap
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.DataFlavor
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.SystemFlavorMap
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.SystemFlavorMap
[2013-06-19 14:19:30 - Flashum2] Warning: org.apache.harmony.awt.datatransfer.TextFlavor: can't find referenced class java.awt.datatransfer.DataFlavor
[2013-06-19 14:19:30 - Flashum2] You should check if you need to specify additional program jars.
[2013-06-19 14:19:30 - Flashum2] Warning: there were 247 unresolved references to classes or interfaces.
[2013-06-19 14:19:30 - Flashum2] You may need to specify additional library jars (using '-libraryjars').
[2013-06-19 14:19:30 - Flashum2] java.io.IOException: Please correct the above warnings first.
[2013-06-19 14:19:30 - Flashum2] at proguard.Initializer.execute(Initializer.java:321)
[2013-06-19 14:19:30 - Flashum2] at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-06-19 14:19:30 - Flashum2] at proguard.ProGuard.execute(ProGuard.java:86)
[2013-06-19 14:19:30 - Flashum2] at proguard.ProGuard.main(ProGuard.java:492)
Here is the list of jars in my libs folder if that helps:
05/31/2013 10:47 AM <DIR> .
05/31/2013 10:47 AM <DIR> ..
05/15/2012 09:22 AM 34,093 acra-3.1.2.jar
01/14/2013 09:07 AM 51,643 activation.jar
01/14/2013 09:06 AM 46,184 additionnal.jar
05/25/2013 04:14 PM 501,154 android-support-v13.jar
05/15/2012 09:22 AM 312,866 commons-lang3-3.0.1.jar
05/15/2012 09:22 AM 269,014 commons-net-3.0.1.jar
05/31/2013 10:47 AM 170,927 google-api-client-1.14.1-beta.jar
05/31/2013 10:47 AM 9,068 google-api-client-android-1.14.1-beta.jar
05/31/2013 10:47 AM 137,977 google-api-services-drive-v2-rev76-1.14.2-beta.jar
05/31/2013 10:47 AM 268,450 google-http-client-1.14.1-beta.jar
05/31/2013 10:47 AM 10,072 google-http-client-android-1.14.1-beta.jar
05/31/2013 10:47 AM 7,828 google-http-client-gson-1.14.1-beta.jar
05/31/2013 10:47 AM 6,038 google-http-client-jackson-1.14.1-beta.jar
05/31/2013 10:47 AM 6,076 google-http-client-jackson2-1.14.1-beta.jar
05/31/2013 10:47 AM 64,952 google-oauth-client-1.14.1-beta.jar
05/31/2013 10:47 AM 180,110 gson-2.1.jar
05/31/2013 10:47 AM 206,797 jackson-core-2.1.3.jar
05/31/2013 10:47 AM 232,131 jackson-core-asl-1.9.11.jar
05/31/2013 10:47 AM 33,015 jsr305-1.3.9.jar
01/14/2013 09:06 AM 440,508 mail.jar
05/15/2012 09:22 AM 134,421 zip4j_1.2.5.jar
Maybe a bit late, but searching for a solution to a similar problem, I learned that you have to tell proguard to keep some classes in your libs jars. Refer to the log where it says Warning: ... and can't find referenced class ....
So in your case should be:
-keep class javax.security.** { *; }
-keep class java.beans.** { *; }
-keep class java.awt.** { *; }
and
-libraryjars libs/XYZ.jar
for every jar into /libs containing those classes.

Android Proguard skip external jar

I tried to use Proguard in my Android project, i setup Proguard using command line 'android update project /path/to/project' and file proguard.cfg was created in project's root directory. (In my Eclipse with Android 2.3 sdk, when create a new project, proguard.cfg file is not automatically created so i have to add it manually using command line).
When i export the project, i got the following errors
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.JettyOAuthConsumer: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2011-02-06 09:02:49 - TestProject] You should check if you need to specify additional program jars.
[2011-02-06 09:02:49 - TestProject] Warning: there were 59 unresolved references to classes or interfaces.
[2011-02-06 09:02:49 - TestProject] You may need to specify additional library jars (using '-libraryjars'),
[2011-02-06 09:02:49 - TestProject] or perhaps the '-dontskipnonpubliclibraryclasses' option.
[2011-02-06 09:02:49 - TestProject] java.io.IOException: Please correct the above warnings first.
[2011-02-06 09:02:49 - TestProject] at proguard.Initializer.execute(Initializer.java:308)
[2011-02-06 09:02:49 - TestProject] at proguard.ProGuard.initialize(ProGuard.java:210)
[2011-02-06 09:02:49 - TestProject] at proguard.ProGuard.execute(ProGuard.java:85)
[2011-02-06 09:02:49 - TestProject] at proguard.ProGuard.main(ProGuard.java:499)
These error messages point to four external jars used in my project
(.classpath)
<classpathentry kind="lib" path="/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-commonshttp4-1.2.1.1.jar"/>
<classpathentry kind="lib" path="/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-core-1.2.1.1.jar"/>
<classpathentry kind="lib" path="/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-jetty6-1.2.1.1.jar"/>
<classpathentry kind="lib" path="/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/twitter4j-core-2.1.6.jar"/>
Here is my proguard.cfg file
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-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
-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 *;
}
I've tried some solutions found on web by adding '-libraryjars' option, ex:
-libraryjars /Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/twitter4j-core-2.1.6.jar
but it won't help.
Any solutions?
Your library jars refer to yet more library jars (Mortbay, SLF4J, Apache Commons Logging, Log4j, ...) Adding these jars with extra '-libraryjars' options should solve the problem.
If you are absolutely sure that your code doesn't use these libraries, you can specify '-ignorewarnings' or '-dontwarn', e.g.
-dontwarn org.mortbay.**
-dontwarn org.slf4j.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.codec.binary.**

Categories

Resources