Search code examples
ios7geofencinggimbal

Gimbal Geofence monitoring crashing NSInvalidArgumentException -[NSURL initFileURLWithPath:]


After integrating Gimbal FYX beacon discovery I tried to add Geofence monitoring as well. I've follow the guides closely and re-written the code several times, ending up with the same crash and error message:

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter'

Nowhere in my code am I accessing any files or creating any NSObjects from initWithContentsOfFile: methods!

My Code:

[connector enableFromViewController:viewController success:^{
        NSLog(@"ContextCoreConnector ACTIVATED!");
        self.placeConnector = [[QLContextPlaceConnector alloc] init];
        self.placeConnector.delegate = self;

        [self.placeConnector monitorPlacesWhenAllowed];
        [self.placeConnector monitorPlacesInBackground];

        if ([self.geofenceDelegate respondsToSelector:@selector(startedGeofenceMonitoring)]) {
            [self.geofenceDelegate startedGeofenceMonitoring];
        }

    } failure:^(NSError *error) {
        NSLog(@"ContextCoreConnector FAILED!\n%@",error.localizedDescription);

        if ([self.geofenceDelegate respondsToSelector:@selector(startedGeofenceMonitoring)]) {
            [self.geofenceDelegate startedGeofenceMonitoring];
        }

    }];

Solution

  • Turns out in the ContextLocation.framework there is a folder called "Resources" and there is a DataModels.bundle file that you need to check the 'Target Membership' in the right side panel of XCode. I had checked all my frameworks as the guides suggested but not that Resources folder.