Jonathan Caryl
Jonathan Caryl

Reputation: 1330

Android ORMLite DatabaseConfigUtil

I'm using ORMLite on our Android app, and I've previously set up an ormlite_config.txt as described in the documentation

http://ormlite.com/docs/table-config

I've now updated my classes, so I need to regenerate the file, but I can no longer get my DatabaseConfigUtil to run in Eclipse. I've set the Run Configuration as described in the documentation, choosing the local JRE and removing the Android bootstrap entry from the Classpath tab. But I just get a whole bunch of java.lang.NoClassDefFoundError for all the Android-derived classes in my project.

I've obviously changed something since I originally generated the ormlite_config.txt file, as I didn't have any problems before, but I can't see what I've done to break everything.

Can somebody tell me exactly what I should have in my Classpath / source tabs?

Upvotes: 2

Views: 2027

Answers (3)

JensJensen
JensJensen

Reputation: 1017

You have to remove the Android Lib from Bootrap Entries!

Do as follows:

  • Project > Properties > Run/Debug Settings
  • Select the class you want to compile and click edit
  • open tab "classpath" and remove Android Lib from Bootstrap Entries

Upvotes: 0

Henry Wang
Henry Wang

Reputation: 11

I ran into this exact problem and found out a solution myself.

I think the problem came from Google's ADT plugin. Since the plugin manages the Android libraries as private libraries, ORMLite Util cannot find the Android related classes in the project's build path.

The solution is to manually add the android.jar from your android sdk folder (in my case it's C:\android-sdk\platforms\android-18) into the build path as an external jar.

Hope it helps.

Upvotes: 1

Jonathan Caryl
Jonathan Caryl

Reputation: 1330

In the end the instructions in the documentation were all that was required, there was just a pair of bugs introduced in 4.43 that prevented it working as it should. These have now been fixed, and will presumably be in the next version. See https://groups.google.com/forum/?fromgroups=#!topic/ormlite-android/nBuQTVpCs0g

Upvotes: 1

Related Questions