Android Roboguice proguard warning

Parece que no puedo compilar sin advertencias. Esta es la advertencia:

Warning:roboguice.activity.RoboMapActivity: can't find superclass or interface com.google.android.maps.MapActivity Warning:roboguice.activity.RoboSherlockActivity: can't find superclass or interface com.actionbarsherlock.app.SherlockActivity Warning:roboguice.activity.RoboSherlockFragmentActivity: can't find superclass or interface com.actionbarsherlock.app.SherlockFragmentActivity Warning:roboguice.activity.RoboSherlockListActivity: can't find superclass or interface com.actionbarsherlock.app.SherlockListActivity Warning:roboguice.activity.RoboSherlockPreferenceActivity: can't find superclass or interface com.actionbarsherlock.app.SherlockPreferenceActivity Warning:roboguice.activity.SherlockAccountAuthenticatorActivity: can't find superclass or interface com.actionbarsherlock.app.SherlockActivity Warning:roboguice.fragment.RoboSherlockDialogFragment: can't find superclass or interface com.actionbarsherlock.app.SherlockDialogFragment Warning:roboguice.fragment.RoboSherlockFragment: can't find superclass or interface com.actionbarsherlock.app.SherlockFragment Warning:roboguice.fragment.RoboSherlockListFragment: can't find superclass or interface com.actionbarsherlock.app.SherlockListFragment Warning:org.roboguice.shaded.goole.common.cache.Striped64: can't find referenced class sun.misc.Unsafe Warning:org.roboguice.shaded.goole.common.cache.Striped64$1: can't find referenced class sun.misc.Unsafe Warning:org.roboguice.shaded.goole.common.cache.Striped64$Cell: can't find referenced class sun.misc.Unsafe Warning:roboguice.activity.RoboMapActivity: can't find referenced class com.google.android.maps.MapActivity Warning:roboguice.activity.RoboMapActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboMapActivity Warning:roboguice.activity.RoboMapActivity: can't find referenced class com.google.android.maps.MapActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onRestart()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onStart()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onResume()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onPause()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onNewIntent(android.content.Intent)' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onStop()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onDestroy()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboSherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onConfigurationChanged(android.content.res.Configuration)' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onContentChanged()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'void onActivityResult(int,int,android.content.Intent)' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'android.view.View onCreateView(java.lang.String,android.content.Context,android.util.AttributeSet)' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockAccountAuthenticatorActivity: can't find referenced method 'android.view.View onCreateView(android.view.View,java.lang.String,android.content.Context,android.util.AttributeSet)' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.RoboSherlockActivity: can't find referenced class com.actionbarsherlock.app.SherlockActivity Warning:roboguice.activity.RoboSherlockActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboSherlockActivity Warning:roboguice.activity.RoboSherlockActivity: can't find referenced class com.actionbarsherlock.app.SherlockActivity Warning:roboguice.activity.RoboSherlockFragmentActivity: can't find referenced class com.actionbarsherlock.app.SherlockFragmentActivity Warning:roboguice.activity.RoboSherlockFragmentActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboSherlockFragmentActivity Warning:roboguice.activity.RoboSherlockFragmentActivity: can't find referenced class com.actionbarsherlock.app.SherlockFragmentActivity Warning:roboguice.activity.RoboSherlockListActivity: can't find referenced class com.actionbarsherlock.app.SherlockListActivity Warning:roboguice.activity.RoboSherlockListActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboSherlockListActivity Warning:roboguice.activity.RoboSherlockListActivity: can't find referenced class com.actionbarsherlock.app.SherlockListActivity Warning:roboguice.activity.RoboSherlockPreferenceActivity: can't find referenced class com.actionbarsherlock.app.SherlockPreferenceActivity Warning:roboguice.activity.RoboSherlockPreferenceActivity: can't find referenced method 'android.content.res.Resources getResources()' in program class roboguice.activity.RoboSherlockPreferenceActivity Warning:roboguice.activity.RoboSherlockPreferenceActivity: can't find referenced class com.actionbarsherlock.app.SherlockPreferenceActivity Warning:roboguice.activity.SherlockAccountAuthenticatorActivity: can't find referenced class com.actionbarsherlock.app.SherlockActivity Warning:roboguice.activity.SherlockAccountAuthenticatorActivity: can't find referenced method 'android.content.Intent getIntent()' in program class roboguice.activity.SherlockAccountAuthenticatorActivity Warning:roboguice.activity.SherlockAccountAuthenticatorActivity: can't find referenced class com.actionbarsherlock.app.SherlockActivity Warning:roboguice.fragment.RoboSherlockDialogFragment: can't find referenced class com.actionbarsherlock.app.SherlockDialogFragment Warning:roboguice.fragment.RoboSherlockDialogFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in program class roboguice.fragment.RoboSherlockDialogFragment Warning:roboguice.fragment.RoboSherlockDialogFragment: can't find referenced class com.actionbarsherlock.app.SherlockDialogFragment Warning:roboguice.fragment.RoboSherlockFragment: can't find referenced class com.actionbarsherlock.app.SherlockFragment Warning:roboguice.fragment.RoboSherlockFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in program class roboguice.fragment.RoboSherlockFragment Warning:roboguice.fragment.RoboSherlockFragment: can't find referenced class com.actionbarsherlock.app.SherlockFragment Warning:roboguice.fragment.RoboSherlockListFragment: can't find referenced class com.actionbarsherlock.app.SherlockListFragment Warning:roboguice.fragment.RoboSherlockListFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in program class roboguice.fragment.RoboSherlockListFragment Warning:roboguice.fragment.RoboSherlockListFragment: can't find referenced class com.actionbarsherlock.app.SherlockListFragment Warning:there were 118 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) Warning:there were 22 unresolved references to program class members. Your input classes appear to be inconsistent. You may need to recompile the code. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember) :app:proguardAgmobileRelease FAILED 

Intenté agregar Proguard requerido por actionarSherlock pero no ayudó. ¿Es seguro utilizar –declarar si el proyecto funciona bien en el modo de depuración?

Este es mi archivo Proguard:

 -target 1.6 -dontobfuscate -dontoptimize -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -dump ../bin/class_files.txt -printseeds ../bin/seeds.txt -printusage ../bin/unused.txt -printmapping ../bin/mapping.txt # The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. -optimizations !code/simplification/arithmetic -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 class com.google.inject.Binder -keepclassmembers class * { @com.google.inject.Inject <init>(...); } # There's no way to keep all @Observes methods, so use the On*Event convention to identify event handlers -keepclassmembers class * { void *(**On*Event); } -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*(...); } -keep class roboguice.** -keep class org.roboguice.** -keep public class AnnotationDatabaseImpl 

Usando sólo esas líneas en mi archivo Proguard, puedo ocultar la advertencia y compilar mi aplicación.

Tal vez esas líneas pueden ayudar a alguien más:

 -dontwarn roboguice.** -dontwarn org.roboguice.** -keep class roboguice.** { *; } -keep class org.roboguice.** { *; } -keepattributes *Annotation*,Signature -keep class com.google.inject.Binder -keep public class com.google.inject.Inject # keeps all fields and Constructors with @Inject -keepclassmembers,allowobfuscation class * { @com.google.inject.Inject <fields>; @com.google.inject.Inject <init>(...); } 

fuente :

¿Cómo hacer que Proguard ignore las bibliotecas externas?

Inyección con google guice ya no funciona después de la ofuscación con proguard

Intente agregar esto a su archivo proguard.

 -dontwarn roboguice.** 
  • Roboguice inyección en el adaptador
  • Android y RoboGuice - Inyectar vistas en Fragmento?
  • Deserializando un tipo genérico con Jackson
  • ¿Cómo se inyecta impl de alguna interfaz en una actividad de Android utilizando Guice
  • Inyectar objetos de objetos en Class Util (usando Dagger)
  • Cómo inyectar el contexto usando RoboGuice en Android?
  • Interceptor de actividad
  • Proceso se bloquea durante la creación del inyector de RoboGuice, si hay una instancia burlada en cualquier módulo
  • Mocking SQLite-Database durante la prueba de actividad con Robolectric
  • OnViewCreated con la biblioteca de compatibilidad
  • Inyectar objeto con constructor que toma un parámetro usando RoboGuice 2
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.