我刚刚在最近几天发布了一个应用程序并检查了crasalytics,并且我遇到了许多与此错误有关的崩溃io.realm.Realm.getDefaultMediator。当我得到领域的实例时,它似乎崩溃了。我已粘贴下面的堆栈跟踪。
Fatal Exception: java.lang.ExceptionInInitializerError
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by io.realm.exceptions.RealmException: Could not find io.realm.DefaultRealmModuleMediator
at io.realm.Realm.getDefaultMediator(Realm.java:256)
at io.realm.Realm.<clinit>(Realm.java:165)
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by java.lang.ClassNotFoundException: io.realm.DefaultRealmModuleMediator
at java.lang.Class.classForName(Class.java)
at java.lang.Class.forName(Class.java:251)
at java.lang.Class.forName(Class.java:216)
at io.realm.Realm.getDefaultMediator(Realm.java:251)
at io.realm.Realm.<clinit>(Realm.java:165)
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by java.lang.NoClassDefFoundError: io/realm/DefaultRealmModuleMediator
at java.lang.Class.classForName(Class.java)
at java.lang.Class.forName(Class.java:251)
at java.lang.Class.forName(Class.java:216)
at io.realm.Realm.getDefaultMediator(Realm.java:251)
at io.realm.Realm.<clinit>(Realm.java:165)
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by java.lang.ClassNotFoundException: Didn't find class "io.realm.DefaultRealmModuleMediator" on path: DexPathList[[zip file "/data/app/com.electropages.mobile-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.electropages.mobile-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at java.lang.Class.classForName(Class.java)
at java.lang.Class.forName(Class.java:251)
at java.lang.Class.forName(Class.java:216)
at io.realm.Realm.getDefaultMediator(Realm.java:251)
at io.realm.Realm.<clinit>(Realm.java:165)
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
基于堆栈跟踪并基于我们遇到的另一次崩溃,我相信它可能与启用MultiDex有关。崩溃只出现在Android 4.设备上。但是,如果有人可以为我澄清这将是伟大的。
以防万一。另一个问题是这个问题。不确定是否在Android 5设备上发生了链接。
Fatal Exception: io.realm.exceptions.RealmMigrationNeededException: The SavedPart class is missing from the schema for this Realm.
at io.realm.SavedPartRealmProxy.validateTable(SavedPartRealmProxy.java:129)
at io.realm.DefaultRealmModuleMediator.validateTable(DefaultRealmModuleMediator.java:61)
at io.realm.Realm.initializeRealm(Realm.java:553)
at io.realm.Realm.createAndValidate(Realm.java:516)
at io.realm.Realm.create(Realm.java:471)
at io.realm.Realm.getInstance(Realm.java:389)
at io.realm.Realm.getInstance(Realm.java:351)
at io.realm.Realm.getInstance(Realm.java:332)
at com.electropages.mobile.classes.AlertBackgroundService.getAllReminders(AlertBackgroundService.java:57)
at com.electropages.mobile.classes.AlertBackgroundService.onHandleIntent(AlertBackgroundService.java:52)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.os.HandlerThread.run(HandlerThread.java:61)