Realm(v3.5.0)在访问db时抛出异常,如果' android:sharedUserId =" android.uid.system"'包含在Android Manifest

时间:2017-11-05 20:38:04

标签: android realm

我正在开发一款Android手机设备,要求我加入android:sharedUserId="android.uid.system 在我可以访问oem的库之前的清单中。我使用Realm(3.5.0)作为我的ORM。但是每次我尝试使用此错误访问Realm DB时,应用程序都会崩溃:

io.realm.exceptions.RealmError: Unrecoverable error. Permission denied in /home/cc/repo/realm/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 252

下面的完整错误日志:

  

11-05 21:35:29.603 1770-1770 / com.tctpos.tpos W / com.tctpos.tpos:type = 1400 audit(0.0:9302):avc:denied {create} for name =&#34 ; access_control.new_commit.cv" scontext = u:r:system_app:s0 tcontext = u:object_r:system_app_data_file:s0 tclass = fifo_file permissive = 0   11-05 21:35:29.603 1770-1770 / com.tctpos.tpos W / com.tctpos.tpos:type = 1400 audit(0.0:9303):avc:denied {create} for name =" realm_2628177326。 CV" scontext = u:r:system_app:s0 tcontext = u:object_r:system_app_data_file:s0 tclass = fifo_file permissive = 0   11-05 21:35:29.616 1770-1770 / com.tctpos.tpos E / REALM_JNI:jni:ThrowingException 5,/ home / cc / repo / realm / release / realm / realm-library / src / main /中的权限被拒绝cpp / io_realm_internal_SharedRealm.cpp第252行,。   11-05 21:35:29.616 1770-1770 / com.tctpos.tpos E / REALM_JNI:抛出异常:不可恢复的错误。 /home/cc/repo/realm/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp第252行中的权限被拒绝   11-05 21:35:29.618 1770-1770 / com.tctpos.tpos D / AndroidRuntime:关闭VM   11-05 21:35:29.622 1770-1770 / com.tctpos.tpos E / AndroidRuntime:FATAL EXCEPTION:main                                                                  过程:com.tctpos.tpos,PID:1770                                                                  io.realm.exceptions.RealmError:不可恢复的错误。 /home/cc/repo/realm/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp第252行中的权限被拒绝                                                                      at io.realm.internal.SharedRealm.nativeGetSharedRealm(Native Method)                                                                      在io.realm.internal.SharedRealm。(SharedRealm.java:186)                                                                      at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:239)                                                                      at io.realm.internal.SharedRealm.getInstance(SharedRealm.java:202)                                                                      在io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:298)                                                                      在io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:284)                                                                      在io.realm.Realm.getDefaultInstance(Realm.java:281)                                                                      在com.vicpin.krealmextensions.RealmExtensionsKt.queryFirst(RealmExtensions.kt:40)                                                                      在com.tctpos.tpos.entities.TerminalSettingsDaoImpl.get(TerminalSettings.kt:15)                                                                      at com.tctpos.tpos.activities.SettingsActivity.onCreate(SettingsActivity.kt:31)                                                                      在android.app.Activity.performCreate(Activity.java:6012)                                                                      在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)                                                                      在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)                                                                      在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2410)                                                                      在android.app.ActivityThread.access $ 800(ActivityThread.java:151)                                                                      在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1313)                                                                      在android.os.Handler.dispatchMessage(Handler.java:102)                                                                      在android.os.Looper.loop(Looper.java:135)                                                                      在android.app.ActivityThread.main(ActivityThread.java:5348)                                                                      at java.lang.reflect.Method.invoke(Native Method)                                                                      在java.lang.reflect.Method.invoke(Method.java:372)                                                                      在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:947)                                                                      在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)

我真的需要帮助,我该如何解决这个问题?

0 个答案:

没有答案