Platform:
iOS 11
Mapbox SDK version:
3.6.4
scene and map view should load and application should remain running
app crashes with error
{DefaultFileSource}[Database]: cannot open file at line 40843 of [2b0954060f] (Code 14)
...
.mapbox/cache.db) - Undefined error: 0 (Code 14)
Hi, @michealbeatty. Thank you for using Mapbox. I am sorry to hear you are having some issues. Could you please add a code snipet or test app we could use to track the problem?
There's really not much to it, I have a scene with three buttons which segue to a scene which contains a map view . I've tried making the mapviewcontroller the initial view controller and removed all but the example code and get the same error
import UIKit
import Mapbox
class MapViewController: UIViewController {
override func viewDidLoad() {
let mapView = MGLMapView(frame: view.bounds)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
mapView.setCenter(CLLocationCoordinate2D(latitude: 59.31, longitude: 18.06), zoomLevel: 9, animated: false)
view.addSubview(mapView)
}
}
Here is the full error text
2017-12-22 09:05:30.674146-0600 DriveTime[54249:3373869] [INFO] {DefaultFileSource}[Database]: cannot open file at line 40843 of [2b0954060f] (Code 14)
2017-12-22 09:05:30.679871-0600 DriveTime[54249:3373869] [INFO] {DefaultFileSource}[Database]: [2b0954060f]:40843: (0) open(/Users/mike/Library/Developer/CoreSimulator/Devices/2DA4B35A-51B7-48B7-B05B-984AB9EA1132/data/Containers/Data/Application/53B02078-A640-4710-A597-365E77AFE178/Library/Application Support/bundleidentifier/.mapbox/cache.db) - Undefined error: 0 (Code 14)
OK, this is strange. After several days of trying to figure this out, launching on the simulator and on a real device multiple times with no success, I launched in the simulator, then left it. When I returned an hour or so later, the same error was in the debug console and the LLDB server had crashed, but the application was running and I've been able to relaunch a number of times without the issue re-occuring.
@michealbeatty I'm closing this as it looks it's working now.
Do you have exception breakpoints enabled? The first-run database creation flow catches a SQLite exception (Code 14, SQLITE_CANTOPEN) and then creates the database. This is not a crash, though folks frequently interpret it as one, e.g., https://github.com/mapbox/mapbox-gl-native/issues/9761.
@friedbunny I do have exception breakpoints enabled so what you siggest is probably what was happening. Sure seemed like a crash to me.
Thanks for sharing and teaching me something new.
{com.mapbox.mbgl.DefaultFileSour}[Database]: cannot open file at line 40840 of [2b0954060f] (Code 14)
Just started happening after some random re-install of the app. MAJOR BUG
Hackiest solution:
Hi @TimmyBest 鈥斅爄f you鈥檙e seeing a major bug (as opposed to having breakpoints enabled, which is how this specific issue was resolved), we鈥檇 love to try and fix it. If that鈥檚 the case, please open a new issue here and provide as much detail as possible. Thanks!
Most helpful comment
@friedbunny I do have exception breakpoints enabled so what you siggest is probably what was happening. Sure seemed like a crash to me.
Thanks for sharing and teaching me something new.