Skip to content

#900 ios bundle search - #904

Open
ExNDY wants to merge 2 commits into
icerockdev:developfrom
ExNDY:#900-ios-bundle-search
Open

ExNDY wants to merge 2 commits into
icerockdev:developfrom
ExNDY:#900-ios-bundle-search

Conversation

@ExNDY

@ExNDY ExNDY commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Closes #900.

Exporting moko-resources from an iOS framework produced a Kotlin/Native
warning because the export also picked up the bundleSearcher cinterop KLib.
This change removes that interop and uses dladdr to locate the bundle
containing the moko code. Swift callers still get the exported resource APIs.

Bundle lookup checks the selected root's resource directory first and returns
as soon as the requested identifier matches. A recursive search handles
resources stored deeper in that root.

Verification

  • Reproduced the export warning on develop and confirmed it disappeared for
    direct static, CocoaPods static, and dynamic frameworks.
  • Checked Slow loading of string resource at first open of screen #708 with direct lookup timings. With a second bundle containing over
    13,000 files, the median was 4.62 ms on develop and 5.67 ms with this change.
    A control that traversed the entire tree took 262 ms.
  • Compared time to the first moko string across 64 clean-install Debug launches
    on iPhone 17 Simulator, with and without LLDB. The largest increase in any
    median was 50 ms, within the observed run-to-run spread.
  • Checked 0.24.1 Change Causing -> iOS "Bundle with identifier *** not found" Error #747 in a live SwiftUI Preview and with a dynamic framework outside
    the host .app. The framework's bundle won even when the app held a copy
    with the same identifier.
  • Ran 20 iOS simulator tests. A local SwiftPM/XCTest fixture related to Crash when using MR.strings() in unit tests iOS #714
    also passed with static and dynamic frameworks on both revisions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundleSearcher cinterop klib "can't be exported with -Xexport-library" warning when exporting resources from an iOS framework

1 participant