NoClassDefFoundError for javax.inject.Provider after upgrading to RoboGuice 2.0

I got this error when I tried to run one of my apps after upgrading to RoboGuice 2.0.  Whilst I do love RoboGuice and appreciate the hard work of the contributors, the project’s documentation has not had the same attention as the code.

To get things working you’ll need to add another jar in addition to roboguice2 and guice3(no aop).  The new jar is “javax.inject.jar” and you can extract it from the zip distribution of Guice 3.0.  After adding the new jar just add it to your libs folder as normal and try running your app again.

5 thoughts on “NoClassDefFoundError for javax.inject.Provider after upgrading to RoboGuice 2.0

    1. I created a trivial project and added roboguice 2.0 and guice 3.0 (no aop) to libs and added them to the build-path. I then extended from RoboActivity and tried to run the app (compilation was fine). The app force closed on startup complaining about a reference to javax.inject.provider.

      If you like I can email you the project and logs. Perhaps the problem is coming from guice and not roboguice, but the only way I can get my apps to run is by adding the javax.inject jar.

  1. I cannot thank you enough!!!!!!! Many days of googling to find this post which explained what the problem was. Its terrible that their poor documentation means many hours of frustration trying to get simple stuff to work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s