maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.03k stars 299 forks source link

Running macOS sample app crashes on startup #2567

Open apexskier opened 3 months ago

apexskier commented 3 months ago

Describe the bug Running the macOS sample app crashes on startup, either through the CLI as documented or through Xcode.

Crash is:

Assertion failed: (static_cast<RunLoop*>(Scheduler::GetCurrent())), function Get, file run_loop.cpp, line 56.

link to line of code

To Reproduce Follow documentation linked above or run the macos_app target through Xcode 15.0.1.

Expected behavior App runs

Screenshots MapLibre — run_loop cpp - Xcode - 2024-06-29 at 10 14 10@2x

Platform information (please complete the following information):

louwers commented 3 months ago

Hi. On macOS the CFRunLoop was replaced with libuv because, it didn't work with glfw. We need to kick off the libuv based scheduler somewhere, right now AppKit has no scheduler active (I think AppKit kicked off a CFRunLoop automatically). I haven't gotten to it yet. https://github.com/maplibre/maplibre-native/pull/2205

If you just want to renderer run on macOS and use GLFW, you can use:

bazel run //platform/glfw:glfw_app --//:renderer=metal -- --style https://demotiles.maplibre.org/style.json