Realm-java: crash in 4.4

Created on 7 Dec 2017  Â·  3Comments  Â·  Source: realm/realm-java

Expected Results

not crash

Actual Results

12-07 13:32:04.408 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.ImmutableRealmSchema', referenced from method io.realm.Realm.
12-07 13:32:04.418 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.internal.OsSchemaInfo', referenced from method io.realm.Realm.createExpectedSchemaInfo
12-07 13:32:04.418 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.getDefaultModule
12-07 13:32:04.418 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.getDefaultModule
12-07 13:32:04.418 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.getDefaultModule
12-07 13:32:04.428 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.Realm$3', referenced from method io.realm.Realm.getGlobalInstanceCount
12-07 13:32:04.428 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.RealmModel', referenced from method io.realm.Realm.copyFromRealm
12-07 13:32:04.428 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.RealmModel', referenced from method io.realm.Realm.copyToRealm
12-07 13:32:04.438 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.RealmModel', referenced from method io.realm.Realm.copyToRealmOrUpdate
12-07 13:32:04.438 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createAllFromJson
12-07 13:32:04.438 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createAllFromJson
12-07 13:32:04.438 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createObjectFromJson
12-07 13:32:04.438 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createObjectFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateAllFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateAllFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateAllFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateObjectFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateObjectFromJson
12-07 13:32:04.448 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.exceptions.RealmException', referenced from method io.realm.Realm.createOrUpdateObjectFromJson
12-07 13:32:04.478 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.BaseRealm$1', referenced from method io.realm.BaseRealm.
12-07 13:32:04.478 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.BaseRealm$1', referenced from method io.realm.BaseRealm.
12-07 13:32:04.478 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.BaseRealm$6', referenced from method io.realm.BaseRealm.createMigrationCallback
12-07 13:32:04.478 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.BaseRealm$4', referenced from method io.realm.BaseRealm.deleteRealm
12-07 13:32:04.488 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.RealmObjectSchema', referenced from method io.realm.BaseRealm.deleteAll
12-07 13:32:04.498 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.DynamicRealmObject', referenced from method io.realm.BaseRealm.get
12-07 13:32:04.508 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.DynamicRealmObject', referenced from method io.realm.BaseRealm.get
12-07 13:32:04.518 14839-14839/sheng.com.scandroiddemo E/dalvikvm: Could not find class 'io.realm.BaseRealm$3', referenced from method io.realm.BaseRealm.stopWaitForChange
12-07 13:32:04.528 14839-14839/sheng.com.scandroiddemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: sheng.com.scandroiddemo, PID: 14839
java.lang.NoClassDefFoundError: io.realm.internal.async.RealmThreadPoolExecutor
at io.realm.BaseRealm.(BaseRealm.java:72)
at sheng.com.scandroiddemo.MyApplication.onCreate(MyApplication.java:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4438)
at android.app.ActivityThread.access$1500(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5111)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)

public class MyApplication extends Application{
    @Override
    public void onCreate() {
        super.onCreate();
        Realm.init(this);
    }
}

Version of Realm and tooling

Realm version(s):4.3.0

Realm sync feature enabled: no

Android Studio version: 3.0

Which Android version and device: 4.4

Most helpful comment

Do you have multiDexEnabled true in your build.gradle?

Because if yes, then you should be extends MultiDexApplication instead of extends Application.

All 3 comments

Do you have multiDexEnabled true in your build.gradle?

Because if yes, then you should be extends MultiDexApplication instead of extends Application.

It can run normally, thank you. @Zhuinden

@Zhuinden your solution is working fine, thanks for saving my day.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patelnishantk picture patelnishantk  Â·  55Comments

Jonty800 picture Jonty800  Â·  56Comments

cmelchior picture cmelchior  Â·  100Comments

GaelCO picture GaelCO  Â·  66Comments

an-k picture an-k  Â·  139Comments