Closed leanh215 closed 7 years ago
Sounds like version mismatch to me.
I really have no idea with this issue =.=
@leanh215 Is it possible for you to share your project with us? You can do it privately by emailing help@realm.io.
We finally figured it out that in core-module, we built the .aar with old realm version (1.2.0). That's why we got crash. Thank you guys for helping us
compile 'com.xxx:core.module:1.0.3'
Init in MyApplication
Realm.init(this);
RealmConfiguration realmConfig = new RealmConfiguration.Builder() .deleteRealmIfMigrationNeeded() .modules(Realm.getDefaultModule(), new MyRealmCoreModule()) .build();
Realm.setDefaultConfiguration(realmConfig);
Realm defaultInstance = Realm.getDefaultInstance();
When I call Realm.getDefaultInstance(), it causes crash
java.lang.AbstractMethodError: abstract method "io.realm.internal.ColumnInfo io.realm.internal.RealmProxyMediator.validateTable(java.lang.Class, io.realm.internal.SharedRealm, boolean)" at io.realm.Realm.initializeRealm(Realm.java:359) at io.realm.Realm.createAndValidate(Realm.java:317) at io.realm.Realm.createInstance(Realm.java:266) at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:145) at io.realm.Realm.getDefaultInstance(Realm.java:211) at com.mhealth.doctor.DoctorApplication.onCreate(DoctorApplication.java:95) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
If I use core-module as a gradle module, It works like a charm Add to settings.gradle
include ':core-module' project(':core-module').projectDir = new File(settingsDir, '../core-module/library')
And add in app/build.gradlecompile project(':core-module')
I don't know how to fix this issue. Please help