From 84e1187f8a22822c8571187bab7e7953ea27cadc Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 7 Nov 2026 14:56:25 -0800 Subject: [PATCH] fix(runtime): resolve system symbols when an iOS app runs on a Mac On Apple Silicon Macs ("Designed for iPad"), SymbolLoader opens system frameworks at /System/Library/Frameworks. CFBundleCreate succeeds there, but UIKit's symbols live under /System/iOSSupport, so the bundle lookup returns NULL and the loader returned it without trying anything else. @nativescript/core then failed at boot with "ReferenceError: UIApplicationDidFinishLaunchingNotification is not defined". A miss from the module's resolver now falls back to dlsym(RTLD_DEFAULT), which finds the loaded iOSSupport images. --- NativeScript/runtime/SymbolLoader.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NativeScript/runtime/SymbolLoader.mm b/NativeScript/runtime/SymbolLoader.mm index dfd1f1b2..58516c22 100644 --- a/NativeScript/runtime/SymbolLoader.mm +++ b/NativeScript/runtime/SymbolLoader.mm @@ -142,8 +142,13 @@ virtual bool load() override { } void* SymbolLoader::loadFunctionSymbol(const ModuleMeta* module, const char* symbolName) { + // An iOS app on a Mac opens /System/Library/Frameworks bundles that do not carry + // the iOS symbols (those live under /System/iOSSupport), so a miss falls through + // to the process-wide lookup. Applies to loadDataSymbol too. if (auto resolver = this->resolveModule(module)) { - return resolver->loadFunctionSymbol(symbolName); + if (void* symbol = resolver->loadFunctionSymbol(symbolName)) { + return symbol; + } } return dlsym(RTLD_DEFAULT, symbolName); @@ -151,7 +156,9 @@ virtual bool load() override { void* SymbolLoader::loadDataSymbol(const ModuleMeta* module, const char* symbolName) { if (auto resolver = this->resolveModule(module)) { - return resolver->loadDataSymbol(symbolName); + if (void* symbol = resolver->loadDataSymbol(symbolName)) { + return symbol; + } } return dlsym(RTLD_DEFAULT, symbolName);