question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android InstantApp cannot create Realm instance

See original GitHub issue

The constructor of Realm fails with the following exception:

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.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
pmpurocommented, Oct 25, 2021

Filed an issue on this for Google.

0reactions
pmpurocommented, Oct 22, 2021

Thanks for response. Okay, I realized that it’s about Android itself. That’s a shame still.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Instant App with Android 10 has thrown "Permission denied in ...
It only happens when running Instant App on Android 10. For more information, we init realm instance like this: private fun initRealm(): Realm...
Read more >
Problem with getting Realm instance on Android - MongoDB
Hello, When I try to get a realm instance the whole app stops, a white screen occurs (I have UI, but it doesn't...
Read more >
Making Your App Instant - Realm Academy
You can have an instant app that is pinned to the launch screen on Android and you can have someone open it up...
Read more >
Correctly handling Realm intances on Android - Stack Overflow
You don't need to have one class only to handle Realm management. Realm already manages multiple instances so it is perfectly safe.
Read more >
Define relationships between objects - Android Developers
Finally, add a method to the DAO class that returns all instances of the data class that pairs the parent entity and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found