AbstractMethodError

88 views
Skip to first unread message

Mark Andrachek, Jr.

unread,
Oct 26, 2015, 12:56:49 PM10/26/15
to Realm Java
I'm attempting to initialize realm in my onCreate() in an IntentService, and it crashes every time:

java.lang.AbstractMethodError: abstract method "java.util.List io.realm.internal.RealmProxyMediator.getModelClasses()"
at io.realm.internal.RealmProxyMediator.hashCode(RealmProxyMediator.java:144)
at io.realm.RealmConfiguration.hashCode(RealmConfiguration.java:156)
at java.util.Collections.secondaryHash(Collections.java:3405)
at java.util.HashMap.get(HashMap.java:300)
at io.realm.Realm.createAndValidate(Realm.java:265)
at io.realm.Realm.create(Realm.java:247)
at io.realm.Realm.getInstance(Realm.java:219)
at io.realm.Realm.getInstance(Realm.java:182)

I tried moving the creation into an Activity, to see if that would work any better. It's like it doesn't know how to find my model classes (in data/model).
My model classes extend RealmObject, everything compiles fine... but it looks like it's failing to find them? I tried added the @RealmClass annotation to my model objects, but no luck there.

This is with realm 0.84. All my model classes are in data/model.
Any ideas or help would be appreciated.

Thanks,
Mark

Mark Andrachek, Jr.

unread,
Oct 26, 2015, 4:41:19 PM10/26/15
to Realm Java
Looks like this was a side-effect of the dreaded unsatisfied link error.

It's also a multidex build using multidex-compat 1.0.1 and gradle 1.4-beta6.
It doesn't appear that any native code makes it into the build, unless it's bundled up in one of the .dex files.

Thanks,
Mark

Mark Andrachek, Jr.

unread,
Oct 26, 2015, 5:38:05 PM10/26/15
to Realm Java
Yeah, so, this is apparently a bug with gradle 1.4-beta, where it's not copying the jni libs from the jar file. 
I switched to using the embedded .jar and libs rather than a gradle dependency, and it's all good.

Kenneth Geisshirt

unread,
Oct 27, 2015, 3:52:55 AM10/27/15
to Mark Andrachek Jr., realm...@googlegroups.com
Hey Mark,

It sounds like you resolved the issue yourself ;-) And yeah, the bug in gradle 1.4-beta is pretty annoying. I believe you can follow the evolution of the bug at https://code.google.com/p/android/issues/detail?id=188237 (consider starring it to show interest).

Best,
Kenneth

--
Kenneth Geisshirt
Member of technical staff


--
You received this message because you are subscribed to the Google Groups "Realm Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-java+...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-java/e7709ea5-eeed-41d3-aa75-66e880e89f82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



{#HS:133374894-2137#}
Reply all
Reply to author
Forward
0 new messages