fix(flutter): stage xcframework slice via script_phase — iOS CocoaPods link (issue #25) - #26
Merged
Merged
Conversation
CocoaPods' automatic xcframework script is not mounted in Flutter
projects (base configuration conflict), so the vendored framework never
reached the link step ('Framework aimux_ffi not found'). The podspec now
runs embed-xcframework.sh as a script_phase (pod target build, before
compile): it copies the slice selected by SDK_NAME into
PODS_XCFRAMEWORKS_BUILD_DIR/aimux, which is already in the app's
FRAMEWORK_SEARCH_PATHS. force_load now points at the staged framework
(unconditional — only one slice is ever staged). CI iOS job is blocking
again with the nm symbol check.
Slice staging fixed the 'Framework not found' error, but the app link never consumed the framework: CocoaPods did not emit -framework aimux_ffi for the vendored xcframework. Add -framework aimux_ffi (resolved via the existing FRAMEWORK_SEARCH_PATHS entry) plus -force_load for the staged archive so DynamicLibrary.process() finds the symbols.
With use_frameworks, aimux builds as a dynamic framework and the vendored static library links into IT, not into the app. The -framework/-force_load flags therefore belong in pod_target_xcconfig (the pod's own link step); app-level flags never pulled the archive members in. The staged slice path (PODS_XCFRAMEWORKS_BUILD_DIR) is valid in the pod build context, same as the staging script_phase.
…real result The first diagnostic grep returned exit 2 (missing xcconfig path) and bash -e aborted the step before the symbol check ran — the build itself may have been fine. Symbol check now runs first and prints OK/FAIL explicitly; diagnostics are best-effort (|| true).
…, settings, pod file type)
… must live in the main executable Verified via full xcodebuild logs: aimux is a DYNAMIC framework under use_frameworks; pod_target_xcconfig's force_load landed in aimux.framework (clang -dynamiclib ... -force_load ... -o aimux), which is never embedded (Runner.app/Frameworks empty). Dart uses DynamicLibrary.process() (dlsym RTLD_DEFAULT), so symbols must be in the main binary. user_target_xcconfig reaches Runner's link (Pods xcconfig is consumed). Consulted gpt-5.6-sol + glm-5.2 (issue #25).
…unner.debug.dylib The debug simulator build compiles the app code into Runner.debug.dylib (link command: -o Binary/Runner.debug.dylib); Runner.app/Runner is a thin stub, so checking it directly always came up empty. Scan every executable inside Runner.app instead.
Verified fix (issue #25): force_load via user_target_xcconfig puts the Rust symbols into the main executable (Runner.debug.dylib in debug builds). Keep the whole-app symbol scan as the guard; remove verbose linkage diagnostics.
zerob13
pushed a commit
to zerob13/aimux
that referenced
this pull request
Aug 5, 2026
…rcships#26), SPM limitation recorded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Closes #25 — iOS 构建在链接阶段失败:\Framework 'aimux_ffi' not found\。
根因
Flutter 项目自定义了构建配置(base configuration),CocoaPods 的自动 xcframework 解包脚本(\Pods-*-frameworks.sh\)没有被挂载到 target——vendored framework 从未进入链接输入。pod install 警告:\CocoaPods did not set the base configuration...\。
修复
m\ 符号检查(阻塞)
验证
m -g Runner | grep aimux_openai_new\ 符号存在(force_load 生效)