I'm newbie of the RoboGuice, After cloning the git repository, I did the following:
mvn install
which show success. Then I cd to the astroboy and executing:
mvn package
mvn android:deploy
which show me that the android-support related class could not be found, then I add the dependency, but still got:
11-25 16:41:50.984 7957-7957/org.roboguice.astroboy I/Process﹕ Sending signal. PID: 7957 SIG: 9
11-25 16:41:51.844 8095-8095/org.roboguice.astroboy D/roboguice.RoboGuice﹕ Using annotation database(s).
11-25 16:41:51.854 8095-8095/org.roboguice.astroboy D/roboguice.RoboGuice﹕ Using annotation database(s) : [, roboguice]
11-25 16:41:51.854 8095-8095/org.roboguice.astroboy D/roboguice.RoboGuice﹕ Time spent loading annotation databases : 4
11-25 16:41:51.984 8095-8095/org.roboguice.astroboy E/MoreInfoHPW_ViewGroup﹕ Parent view is not a TextView
11-25 16:41:52.054 8095-8095/org.roboguice.astroboy D/AndroidRuntime﹕ Shutting down VM
11-25 16:41:52.054 8095-8095/org.roboguice.astroboy W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41c5f898)
11-25 16:41:52.054 8095-8095/org.roboguice.astroboy E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NullPointerException
at org.roboguice.astroboy.view.CustomView.onAttachedToWindow(CustomView.java:38)
at android.view.View.dispatchAttachedToWindow(View.java:13030)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2683)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2690)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2690)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2690)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2690)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1461)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1253)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6402)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:561)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)
at dalvik.system.NativeStart.main(Native Method)
Any comment?
If you are referring to the Astroboy Example, the following is one of the possible solutions.
You could add the following lines:
RoboGuice.injectMembers(getContext(), this);
RoboGuice.getInjector(getContext()).injectViewMembers(this);
after Layout Inflation
LayoutInflater.from(context).inflate(R.layout.view_custom, this, true);
in the initializeView() method. Then the problem can be solved.