I need your help with this error, it's happening to me a lot, it's being generated on the line where I instantiate my realm, I understand that deleting the database file and recreating it could solve it, but how could I do it? this??
Caused by: io.realm.exceptions.RealmFileException: Unable to open a realm at path '/data/data/com.myapp/files/default.realm': Invalid top array (ref: 222488, size: 11)
Exception backtrace:
<backtrace not supported on this platform> Path:Exception backtrace:
<backtrace not supported on this platform>. (Invalid top array (ref: 222488, size: 11)
Exception backtrace:
<backtrace not supported on this platform> Path:
/data/data/com.myapp/files/default.realm
Exception backtrace:
<backtrace not supported on this platform>) (/data/data/com.myapp/files/default.realm) in /Users/cm/Realm/realm-java-release/realm/realm-library/src/main/cpp/io_realm_internal_OsSharedRealm.cpp line 101
In this way I establish the instance of my realm
Realm.init( MyApp.instance )
val config = RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded()
.build()
realm = Realm.getInstance(config)