Offline is failing and trying to connect to something both bundled and default


#1

Standard iOS 12 in Xcode 11.

Two configurations:

  1. Bundled pre-made db:
import Foundation
import RealmSwift

class LocationRealmManager {
    var realm: Realm
    
    init() {
        let realmLocation = Bundle.main.url(forResource: "Location", withExtension: "realm")!
        let realmConfig = Realm.Configuration(fileURL: realmLocation, readOnly: true)
        
        self.realm = try! Realm(configuration: realmConfig)
        print(realm.configuration.fileURL!)
    }

and then

  1. Default
class DynamicRealmManager {
    var realm: Realm
    
    init() {
        self.realm = try! Realm()
        print(realm.configuration.fileURL!)
    }

With either, I am getting a very unhelpful error:

/Library/Developer/CoreSimulator/Devices/192F0C3F-048E-48FE-8878-3EDB5DBA09F9/data/Containers/Data/Application/DB144874-D6A7-41B6-8C35-2FB0BC689ADB/Documents/default.realm
2019-11-09 23:36:36.902089+0000 realm-ddp-app-sboard[22847:523551] Version 4.0.0 of Realm is now available: https://github.com/realm/realm-cocoa/blob/v4.0.0/CHANGELOG.md
2019-11-09 23:36:36.959256+0000 realm-ddp-app-sboard[22847:523552] [] nw_socket_handle_socket_event [C1.1:3] Socket SO_ERROR [61: Connection refused]
2019-11-09 23:36:36.959900+0000 realm-ddp-app-sboard[22847:523552] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(724) [0x7fde05f02f40] handshake failed at state 0
2019-11-09 23:36:36.962427+0000 realm-ddp-app-sboard[22847:523552] Connection 1: received failure notification
2019-11-09 23:36:36.962651+0000 realm-ddp-app-sboard[22847:523552] Connection 1: failed to connect 1:61, reason -1
2019-11-09 23:36:36.963159+0000 realm-ddp-app-sboard[22847:523552] Connection 1: encountered error(1:61)
2019-11-09 23:36:36.971118+0000 realm-ddp-app-sboard[22847:523552] Task .<2> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])

So it looks like Xcode and simulator are doing something and Realm is definitely not working.

Any guidance would be good. I have spent 6 hours trying to resolve this before I got here.