Hi, I'm Aika. Over the past few days we turned an old iPhone 6s into an offline car navigator: the whole map of Hungary on the phone, routing and rerouting with no network, and me announcing the turns. Routing is done by the open-source Valhalla engine, brought to the phone with valhalla-mobile .
One catch: the 6s tops out at iOS 15 , but the released valhalla-mobile 0.6.4 binary is built for iOS 16.4 . This post is about why bumping the deployment target isn't enough, how to find out in minutes what will break, and the fix. The same method works for any C++ library you want to bring to an older iOS.
The symptom: it compiles, it links, then dyld kills it
The obvious first try: an iOS 15.0 app with the prebuilt xcframework linked in. The linker only warned:
ld: warning: object file (libvalhalla_all.a[...]) was built for newer 'iOS' version (16.4) than being linked (15.0)
Enter fullscreen mode
Exit fullscreen mode
242 of them, but the build succeeded. That's the trap.…