Issue 721 in google-guice: NoClassDefFoundError com.google.inject.Module

11 views
Skip to first unread message

google...@googlecode.com

unread,
Aug 2, 2012, 5:30:05 AM8/2/12
to google-g...@googlegroups.com
Status: New
Owner: ----

New issue 721 by alexa...@gmail.com: NoClassDefFoundError
com.google.inject.Module
http://code.google.com/p/google-guice/issues/detail?id=721

Description of the issue:
I newed an android project, using Guice to inject class; But when i run it,
ClassNotFoundException happens.

ps The Exception happened after i updated the Android Plugin newest version
in eclipse,i couldn't settle it.

Version:
jdk-6u33-windows-x64
guice-2.0-no_aop
Android 2.1

Code:--------------------------------------------------------------------------
public class TextApplication{
....
public void onCreate() {
super.onCreate();
singleton = this;

this.in = Guice.createInjector(new BaseModule()); //Exception
happens
........
}

public class BaseModule implements Module {

@Override
public void configure(Binder binder) {
binder.bind(ServiceRequest.class).in(Scopes.SINGLETON);
binder.bind(TService.class).in(Scopes.SINGLETON);
.......
}

}
--------------------------------------------------------------------------

Log:--------------------------------------------------------------------------
08-02 16:28:26.646: E/dalvikvm(18212): Could not find
class '[Lcom.google.inject.Module;', referenced from method
com.shuyou.shop.TextApplication.onCreate
08-02 16:28:26.656: W/dalvikvm(18212): VFY: unable to resolve new-array 588
([Lcom/google/inject/Module;) in Lcom/shuyou/shop/TextApplication;
08-02 16:28:26.656: W/dalvikvm(18212): threadid=1: thread exiting with
uncaught exception (group=0x2aacc8a0)
08-02 16:28:26.666: E/AndroidRuntime(18212): FATAL EXCEPTION: main
08-02 16:28:26.666: E/AndroidRuntime(18212):
java.lang.NoClassDefFoundError: [Lcom.google.inject.Module;
08-02 16:28:26.666: E/AndroidRuntime(18212): at
com.shuyou.shop.TextApplication.onCreate(TextApplication.java:27)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:4286)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread.access$3000(ActivityThread.java:132)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2109)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.os.Looper.loop(Looper.java:123)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
android.app.ActivityThread.main(ActivityThread.java:4669)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
java.lang.reflect.Method.invokeNative(Native Method)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
java.lang.reflect.Method.invoke(Method.java:521)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
08-02 16:28:26.666: E/AndroidRuntime(18212): at
dalvik.system.NativeStart.main(Native Method)
--------------------------------------------------------------------------


google...@googlecode.com

unread,
Feb 14, 2014, 12:55:20 AM2/14/14
to google-g...@googlegroups.com
Updates:
Status: Invalid

Comment #1 on issue 721 by christia...@gmail.com: NoClassDefFoundError
com.google.inject.Module
http://code.google.com/p/google-guice/issues/detail?id=721

This error means, inherently, that you do not have the bytecode for Guice
compiled into your app. I expect that you are using Proguard and possibly
it cleaned away bits of Guice. Otherwise, it must be an incorrectly
specified dependency list in your build system.

This is not a Guice bug, but might be a reasonable stackoverflow question.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages