Realm crash in iPhone X, permission issues

(Sarvjeet Singh) #1

Hi Realm Team,

First of all thanks for providing such a robust DB library for the mobile platform.

I want your help in debugging a crash which is happening a lot for past few days

It is mostly happening in iPhoneX device with {iOS 12.2.0, 12.3.1}.
It seems to be having some permission issues while accessing the primary Realm DB.
Following is the detail of the crash provided by Fabric Crashlytics:

Fatal error: ‘try!’ expression unexpectedly raised an error: Error Domain=io.realm Code=2 “Unable to open a realm at path ‘/var/mobile/Containers/Data/Application/DF0CC44C-45BC-4212-B354-8266BA1BC044/Documents/realm/default.realm.lock’: open() failed: Operation not permitted.” UserInfo={Error Code=2, NSFilePath=/var/mobile/Containers/Data/Application/DF0CC44C-45BC-4212-B354-8266BA1BC044/Documents/realm/default.realm.lock, Underlying=open("/var/mobile/Containers/Data/Application/DF0CC44C-45BC-4212-B354-8266BA1BC044/Documents/realm/default.realm.lock") failed: Operation not permitted, NSLocalizedDescription=Unable to open a realm at path ‘/var/mobile/Containers/Data/Application/DF0CC44C-45BC-4212-B354-8266BA1BC044/Documents/realm/default.realm.lock’: open() failed: Operation not permitted.}: file /BuildRoot/Library/Caches/, line 184

Please assist me on debugging this issue as soon as you guys can do.

(Zsolt Jandzso) #2

It seems that you are using force try somewhere.
I would definitelly check those out, and if i can then change it to a try - catch block.

(LindaZhou) #3

If there is nothing wrong with this app, maybe there is something bad with your iPhone X. If it is the case, you can have a try with Joyoshare UltFix that the only one repairing tool I have used. I have ever applied it to fix app keeps crashing on my iPhone XS. It will keep iPhone data safe during the process and support all iOS devices. Maybe this method can work for you.