public class MyActivity extends RoboActivity {
@Inject MyService1 myService1;
@InjectView(R.id.resultTextView) TextView result;
}
public class MyService1 {
@Inject
MyService2 myService2;
private Context context;
@Inject
public MyService1 (Provider<Context> contextProvider) {
this.context = contextProvider.get();
}
}
public class MyService2 {
}
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.something.activity.MyActivity}: com.google.inject.ConfigurationException: Guice configuration errors:
1) Could not find a suitable constructor in org.something .c.b.a. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
at org.something.c.b.a.class(Unknown Source)
while locating org.something.c.b.a
for field at org.something.c.a.a.myService2(Unknown Source)
while locating org.something.c.a.a
for field at org.something.activity.MyActivity.myService1(Unknown Source)
while locating org.something.activity.MyActivity
--
You received this message because you are subscribed to the Google Groups "roboguice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to roboguice+...@googlegroups.com.
To post to this group, send email to robo...@googlegroups.com.
Visit this group at http://groups.google.com/group/roboguice.
For more options, visit https://groups.google.com/groups/opt_out.
#http://stackoverflow.com/questions/5582383/problem-with-proguard-and-roboguice-with-inject-annotations
-keepattributes Signature
-keepattributes *Annotation*
-keep class roboguice.**
# If not using Google Maps library, safe to ignore these!
-dontwarn roboguice.activity.RoboMapActivity
# Safe to ignore testing classes, when ProGuard not being run against an instrumentation testing application!
-dontwarn roboguice.test.**
-keep class com.google.inject.** { *; }
-keepclassmembers class * {
@com.google.inject.Inject <fields>;
@com.google.inject.Inject <init>(...);
}
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
# Removing logging calls (verbose and debug levels) as per Google's Preparing for Release guide!
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** d(...);
}