-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
I'm trying to instantiate realm object using this code
public synchronized Realm provideRealm(){ if (mRealm == null){ Realm.init(mContext); RealmConfiguration config = new RealmConfiguration.Builder() .name("abcdef.realm") .schemaVersion(5) .deleteRealmIfMigrationNeeded() .build(); mRealm = Realm.getInstance(config); } else if (mRealm.isClosed()){ mRealm = null; provideRealm(); } return mRealm; }
getting this exception and app is unable to open.
Fatal Exception: io.realm.exceptions.RealmFileException
Unable to open a realm at path '/data/data/com.myapp.app/files/abcdef.realm': Incompatible histories. Expected a Realm with no or in-realm history. (Incompatible histories. Expected a Realm with no or in-realm history) (/data/data/com.myapp.app/files/abcdef.realm) in /home/cc/repo/realm/release/realm/realm-library/src/main/cpp/io_realm_internal_SharedRealm.cpp line 91
How to solve this problem it is happeing in many devices like huawei, xiaomi...
Version of Realm and tooling
Realm version(s): 3.7.2
Realm sync feature enabled: no
Android Studio version: 3.0.1