{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/5767","repository_url":"https://api.github.com/repos/realm/realm-java","labels_url":"https://api.github.com/repos/realm/realm-java/issues/5767/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/5767/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/5767/events","html_url":"https://github.com/realm/realm-java/issues/5767","id":300006268,"number":5767,"title":"Fatal Exception: io.realm.exceptions.RealmFileException","user":{"login":"hangonsushant","id":31472291,"avatar_url":"https://avatars3.githubusercontent.com/u/31472291?v=4","gravatar_id":"","url":"https://api.github.com/users/hangonsushant","html_url":"https://github.com/hangonsushant","followers_url":"https://api.github.com/users/hangonsushant/followers","following_url":"https://api.github.com/users/hangonsushant/following{/other_user}","gists_url":"https://api.github.com/users/hangonsushant/gists{/gist_id}","starred_url":"https://api.github.com/users/hangonsushant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hangonsushant/subscriptions","organizations_url":"https://api.github.com/users/hangonsushant/orgs","repos_url":"https://api.github.com/users/hangonsushant/repos","events_url":"https://api.github.com/users/hangonsushant/events{/privacy}","received_events_url":"https://api.github.com/users/hangonsushant/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-25T07:45:43Z","updated_at":"2018-02-27T11:00:37Z","closed_at":null,"author_association":"NONE","body":"I'm trying to instantiate realm object using this code\r\n\r\n```\r\npublic synchronized Realm provideRealm(){\r\n        if (mRealm == null){\r\n            Realm.init(mContext);\r\n            RealmConfiguration config = new RealmConfiguration.Builder()\r\n                    .name(\"abcdef.realm\")\r\n                    .schemaVersion(5)\r\n                    .deleteRealmIfMigrationNeeded()\r\n                    .build();\r\n            mRealm = Realm.getInstance(config);\r\n        } else if (mRealm.isClosed()){\r\n            mRealm = null;\r\n            provideRealm();\r\n        }\r\n        return mRealm;\r\n    }\r\n```\r\n\r\ngetting this exception and app is unable to open.\r\n\r\n```\r\nFatal Exception: io.realm.exceptions.RealmFileException\r\nUnable 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\r\n```\r\n\r\nHow to solve this problem it is happeing in many devices like huawei, xiaomi...\r\n\r\n#### Version of Realm and tooling\r\nRealm version(s): 3.7.2\r\n\r\nRealm sync feature enabled: no\r\n\r\nAndroid Studio version: 3.0.1\r\n\r\nAndroid version and device: 7.0, Galaxy S6 \r\n--\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/368833582","html_url":"https://github.com/realm/realm-java/issues/5767#issuecomment-368833582","issue_url":"https://api.github.com/repos/realm/realm-java/issues/5767","id":368833582,"user":{"login":"cmelchior","id":406066,"avatar_url":"https://avatars3.githubusercontent.com/u/406066?v=4","gravatar_id":"","url":"https://api.github.com/users/cmelchior","html_url":"https://github.com/cmelchior","followers_url":"https://api.github.com/users/cmelchior/followers","following_url":"https://api.github.com/users/cmelchior/following{/other_user}","gists_url":"https://api.github.com/users/cmelchior/gists{/gist_id}","starred_url":"https://api.github.com/users/cmelchior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmelchior/subscriptions","organizations_url":"https://api.github.com/users/cmelchior/orgs","repos_url":"https://api.github.com/users/cmelchior/repos","events_url":"https://api.github.com/users/cmelchior/events{/privacy}","received_events_url":"https://api.github.com/users/cmelchior/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T11:00:37Z","updated_at":"2018-02-27T11:00:37Z","author_association":"CONTRIBUTOR","body":"Hi @hangonsushant \r\nIt looks like the Realm \"abcdef.realm\" might already exist. Normally that error is thrown if you try to open a synchronized Realm the wrong way, but it sounds like you are not using the Realm Object Server.\r\n\r\nIn that case, my best guess is that the Realm file has become corrupted somehow. Is it something you can reproduce locally?"}}
{"actor":{"display_login":"cmelchior"}}