3

How can I prevent this error from crashing my app, while still keeping my realms encrypted?

I noticed that the example projects provided by Realm work fine, why does mine throw this exception?

Cannot open an encrypted Realm with a debugger attached to the process*** Terminating app due to uncaught exception 'RLMException', reason: 'Cannot open an encrypted Realm with a debugger attached to the process'

It states in the instructions that I must set "REALM_DISABLE_ENCRYPTION=YES", but where do I do this? Is there a way around this so that I can still debug the encrypted version? Do I set the value to =NO when uploading to the app store?

  • 1
    Edit your scheme (command+shift+<), select `Run`, select `Arguments` and add it to `Environment Variables`. And, no... this affects only the debug run. – Alladinian May 25 '15 at 11:41
  • Thank you so much for clearing alot of that up, I get `open() failed: Permission denied Unable to open a realm at path 'CustomRealm'. Please use a path where your app has read-write permissions.` when setting a custom realm, do you know if that is supported? – TheFriendlyDinkleberg May 25 '15 at 11:47
  • At that point, it's asking for the full file path to your realm file; right now, that's pointing straight at the root directory of your device. ;) If you're setting a custom realm file, make sure you get the system file path to your app's Documents directory and then append the name of the realm file to the end of that. – TiM May 25 '15 at 17:09

0 Answers0