Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

App crashes on cannot open file error (cache.db) #10789

Closed

Description

@michealbeatty

Platform:
iOS 11
Mapbox SDK version:
3.6.4

Steps to trigger behavior

  1. add MGLMapView to application (storyboard or code)
  2. launch application
  3. open scene with MGLMapView

Expected behavior

scene and map view should load and application should remain running

Actual behavior

app crashes with error
{DefaultFileSource}[Database]: cannot open file at line 40843 of [2b0954060f] (Code 14)
...
.mapbox/cache.db) - Undefined error: 0 (Code 14)

Activity

  1. added
    iOS
    on Dec 22, 2017
  2. fabian-guerra commented on Dec 22, 2017

    @fabian-guerra
    Contributor

    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?

  3. michealbeatty commented on Dec 22, 2017

    @michealbeatty
    Author

    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)
    
  4. michealbeatty commented on Dec 22, 2017

    @michealbeatty
    Author

    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.

  5. fabian-guerra commented on Dec 22, 2017

    @fabian-guerra
    Contributor

    @michealbeatty I'm closing this as it looks it's working now.

  6. friedbunny commented on Dec 22, 2017

    @friedbunny
    Contributor

    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., #9761.

  7. michealbeatty commented on Dec 23, 2017

    @michealbeatty
    Author

    @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.

  8. TimmyBest commented on May 1, 2018

    @TimmyBest

    {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:

    1. Delete the app
    2. Restart the device
    3. Replace the Mapbox framework in the crashing project with the newly downloaded
    4. Delete Derived Data
    5. Clean the project
    6. Thank Mapbox for teaching us to be creative
    7. Continue the work on your project
    8. Hope this will not happen to the users
  9. friedbunny commented on May 1, 2018

    @friedbunny
    Contributor

    Hi @TimmyBest — if you’re seeing a major bug (as opposed to having breakpoints enabled, which is how this specific issue was resolved), we’d love to try and fix it. If that’s the case, please open a new issue here and provide as much detail as possible. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions