I've checked other threads regarding this and haven't managed to have any luck with implementing the answers so have resorted to starting another post. Sorry!
I'm currently completing a Swift course and have run into some issues while using Realm for the first time. Installing Realm into my app with Cocoapods seemed to go to plan but when attempting to open the Realm database (default.realm) I came across the following errors:
Error when opening with Realm Browser, asking for an encryption key (not sure where to get this from, but judging by other posts it seems to be something to do with opening a local version of a synced Realm file) : screenshot1
Error message when opening with Realm Studio: screenshot2
I have tried downloading previous versions of Realm Studio but to no avail. I do not want to update to Xcode 12 just yet as the course I am completing relates to Xcode 11 and I'm halfway through a project. It also seems as though the problem is Realm related.
Here are some details of the cocoapods versions etc.:
PODS:
- Realm (5.4.2):
- Realm/Headers (= 5.4.2)
- Realm/Headers (5.4.2)
- RealmSwift (5.4.2):
- Realm (= 5.4.2)
DEPENDENCIES:
- RealmSwift
SPEC REPOS: trunk: - Realm - RealmSwift
SPEC CHECKSUMS: Realm: ced868eb0254f8d33a21c06981355e5aa33bc005
RealmSwift: aedc4363150f3c61f91ae0537ed116d2d080a4ddPODFILE CHECKSUM: 4b5257d74bf1a8c39ac0b1f3a9a6e9fd23a03b98
COCOAPODS: 1.9.3 ~
"Podfile.lock" 22L, 408C
Here are some further details of what I'm running
ProductName: Mac OS X ProductVersion: 10.15.5 BuildVersion: 19F101
/Applications/Xcode.app/Contents/Developer Xcode 11.6 Build version 11E708
/usr/local/bin/pod 1.9.3 Realm (5.4.2) RealmSwift (5.4.2)
/bin/bash GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
/usr/bin/git git version 2.24.3 (Apple Git-128)
Here is the code from AppDelegate, not sure it'll help but the print statement is how I found the default.realm file:
import UIKit
import CoreData
import RealmSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
print(Realm.Configuration.defaultConfiguration.fileURL!)
let data = Data()
data.name = "Josh"
data.age = 13
do {
let realm = try Realm()
try realm.write {
realm.add(data)
}
} catch {
print("Error initialising new Realm: \(error)")
}
Apologies but I've only just started learning and don't really have a clue where to go from here in opening the default.realm file, so any help would be massively appreciated!