Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-331

Android InstantApp cannot create Realm instance

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Local

      The constructor of Realm fails with the following exception:

      Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      2021-10-12 13:12:07.981 676-676/? E/audit: type=1400 audit(1634033527.971:7153): avc:  denied  { create } for  pid=6348 comm="com.example.app" name="access_control.new_commit.cv" scontext=u:r:ephemeral_app:s0:c126,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c126,c257,c512,c768 tclass=fifo_file permissive=0 SEPF_SM-A805F_11_0010 audit_filtered
      2021-10-12 13:12:07.981 676-676/? E/audit: type=1300 audit(1634033527.971:7153): arch=c00000b7 syscall=33 success=no exit=-13 a0=ffffff9c a1=b400006f85c120d0 a2=1180 a3=0 items=0 ppid=696 pid=6348 auid=4294967295 uid=10382 gid=10382 euid=10382 suid=10382 fsuid=10382 egid=10382 sgid=10382 fsgid=10382 tty=(none) ses=4294967295 comm="com.example.app" exe="/system/bin/app_process64" subj=u:r:ephemeral_app:s0:c126,c257,c512,c768 key=(null)
      2021-10-12 13:12:07.981 676-676/? E/audit: type=1327 audit(1634033527.971:7153): proctitle="com.example.app"
      2021-10-12 13:12:07.984 6348-6348/? E/AndroidRuntime: FATAL EXCEPTION: main
          Process: com.example.app, PID: 6348
          java.lang.RuntimeException: Unable to create application com.example.app.app.Application: java.lang.RuntimeException: [2]: Read-only file system
              at android.app.ActivityThread.handleMakeApplication(ActivityThread.java:7512)
              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7446)
              at android.app.ActivityThread.access$1400(ActivityThread.java:301)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2148)
              at android.os.Handler.dispatchMessage(Handler.java:106)
              at android.os.Looper.loop(Looper.java:246)
              at android.app.ActivityThread.main(ActivityThread.java:8512)
              at java.lang.reflect.Method.invoke(Native Method)
              at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
           Caused by: java.lang.RuntimeException: [2]: Read-only file system
              at io.realm.interop.realmcJNI.realm_open(Native Method)
              at io.realm.interop.realmc.realm_open(realmc.java:291)
              at io.realm.interop.RealmInterop.realm_open(RealmInterop.kt:139)
              at io.realm.interop.RealmInterop.realm_open$default(RealmInterop.kt:138)
              at io.realm.Realm.<init>(Realm.kt:117)
              at com.example.app.shared.impl.db.Db.<init>(Db.kt:27)
      

      The name nor path are not specified in the RealmConfiguration that is given to the constructor.

      It seems that the actual data base file and a lock files are created. However, the run-time exception is thrown saying "Read-only file system". As I understand the first line of the log, access_control.new_commit.cv FIFO file is tried to be created but denied by the sandbox of InstantApp.

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: