我正在编写应用程序,作为数据库,我使用了Realm。一切都很好,直到应用程序发布。现在我在某些设备上遇到了这个错误:
java.lang.ExceptionInInitializerError
at io.realm.Realm.<init>(Realm.java:199)
at io.realm.Realm.createAndValidate(Realm.java:585)
at io.realm.Realm.create(Realm.java:554)
at io.realm.Realm.getInstance(Realm.java:527)
at com.magisto.utils.RealmUtils.createRealmInstance(RealmUtils.java:22)
at com.magisto.infrastructure.viewcount.repository.RealmViewStorage.<init>(RealmViewStorage.java:26)
at com.magisto.infrastructure.module.ViewStorageModule.provideViewStorage(ViewStorageModule.java:19)
at com.magisto.infrastructure.module.ViewStorageModule_ProvideViewStorageFactory.get(ViewStorageModule_ProvideViewStorageFactory.java:23)
at com.magisto.infrastructure.module.ViewStorageModule_ProvideViewStorageFactory.get(ViewStorageModule_ProvideViewStorageFactory.java:9)
at com.magisto.service.background.ViewCountingService.onHandleIntent(ViewCountingService.java:70)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load realm-jni: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at io.realm.internal.RealmCore.loadLibrary(RealmCore.java:144)
at io.realm.internal.SharedGroup.<clinit>(SharedGroup.java:35)
at io.realm.Realm.<init>(Realm.java:199)
at io.realm.Realm.createAndValidate(Realm.java:585)
at io.realm.Realm.create(Realm.java:554)
at io.realm.Realm.getInstance(Realm.java:527)
at com.magisto.utils.RealmUtils.createRealmInstance(RealmUtils.java:22)
at com.magisto.infrastructure.viewcount.repository.RealmViewStorage.<init>(RealmViewStorage.java:26)
at com.magisto.infrastructure.module.ViewStorageModule.provideViewStorage(ViewStorageModule.java:19)
at com.magisto.infrastructure.module.ViewStorageModule_ProvideViewStorageFactory.get(ViewStorageModule_ProvideViewStorageFactory.java:23)
at com.magisto.infrastructure.module.ViewStorageModule_ProvideViewStorageFactory.get(ViewStorageModule_ProvideViewStorageFactory.java:9)
at com.magisto.service.background.ViewCountingService.onHandleIntent(ViewCountingService.java:70)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)
我从jcenter使用了Realm版本0.82.0。问题是在三星S4 mini,三星S5,三星Tab 3 7.0和其他几个设备上找到的。我该如何解决?