realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.46k stars 1.75k forks source link

ClassNotFoundException: io.realm.RealmJsonImpl - Creating FatJar #971

Closed broakenmedia closed 9 years ago

broakenmedia commented 9 years ago

Hello, I'm generating a jar file for eclipse users, this is a requirement and i cannot simply use maven etc...

I am generating the jar file and all of the class files seem to get included:

http://puu.sh/gDmHf/2338563847.png

As well as my main project files with contains my various realm objects.

Can't understand what's going on here, how do i bundle realm in a jar?

cmelchior commented 9 years ago

You are missing all the generated files from the annotation processor, ie. there should be a RealmProxy, RealmJsonImpl and ValidationList files as well.

If you are using Eclipse I think they are placed in the .eclipse directory.

broakenmedia commented 9 years ago

I am using Android studio :)

Any way to get gradle to include them?

Sent from iPhone

On 17 Mar 2015, at 4:08 pm, Christian Melchior notifications@github.com wrote:

You are missing all the generated files from the annotation processor, ie. there should be a RealmProxy, RealmJsonImpl and ValidationList files as well.

If you are using Eclipse I think they are placed in the .eclipse directory.

— Reply to this email directly or view it on GitHub.

cmelchior commented 9 years ago

Android Studio are placing the generated files in build/intermediates/classes/debug/io/realm, so you can copy them from there.

But be aware that trying to make a library with RealmObjects to use by app code is currently not possible, which sounds like what you are trying to do.