-
Type: Bug
-
Resolution: Incomplete
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
How frequently does the bug occur?
Sometimes
Description
I am setting the default config of Realm DB as follows :
class RealmDB : Application() { override fun onCreate() { super.onCreate() try { Log.i(TAG, "Setting RealmDB Default config") Realm.init(this) val config = RealmConfiguration.Builder() .allowWritesOnUiThread(true) .allowQueriesOnUiThread(true) .deleteRealmIfMigrationNeeded() .build() Realm.setDefaultConfiguration(config) } catch (ex : IOException){ Log.e(TAG, "Setting RealmConfiguration failed.") } } }
Then I am trying to get the default instance in my app as follows:
Realm.getDefaultInstance()
But a Permission denied exception is thrown sometimes. The strange thing is that, this exception is thrown randomly. Sometimes, the realm instance is created successfully, but sometimes it fails with the exception.
Stacktrace & log output
Unable to find source-code formatter for language: shell. 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
04-05 16:08:54.606 8888 9006 E REALM_JNI: jni: ThrowingException 7, Permission denied in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107, . 04-05 16:08:54.606 8888 9006 E REALM_JNI: Exception has been thrown: Permission denied in /tmp/realm-java/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 107
Can you reproduce the bug?
Sometimes
Reproduction Steps
Reboot device and launch the app.
Version
classpath 'io.realm:realm-gradle-plugin:10.11.1'
implementation 'io.realm.kotlin:library-base:1.7.0'
What Atlas App Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Android Version 13
Build environment
Android Studio version: ...
Android Build Tools version: ...
Gradle version: ...