feat(apple/android): dual CocoaPods & SwiftPM support with universal Apple XCFramework (arm64 & x86_64) - #111
Open
sebasbad wants to merge 5 commits into
Open
Conversation
This was referenced Aug 2, 2026
sebasbad
marked this pull request as ready for review
August 2, 2026 18:05
sebasbad
marked this pull request as draft
August 2, 2026 20:00
…anager support Restores CocoaPods compatibility (llama_cpp_dart.podspec) alongside the newly added SwiftPM manifest (Package.swift) for Flutter iOS apps with CocoaPods-only dependencies (e.g. google_mobile_ads). Key Changes: - Added llama_cpp_dart.podspec, ios/llama_cpp_dart.podspec, and darwin/llama_cpp_dart.podspec vendoring llama-xcframework.zip. - Updated pubspec.yaml with podspecPath: llama_cpp_dart.podspec under iOS/macOS platform declarations. - Bundled native/android/llama-cpp-dart.aar in repository for git dependency compatibility. - Fixed iOS dynamic framework symbol lookup (LlamaLibrary.loadFromProcess) to support case-sensitive physical device APFS paths (Llama.framework/Llama).
sebasbad
force-pushed
the
feat/cocoapods-swiftpm-dual-support
branch
from
August 2, 2026 20:11
c598bf9 to
659f80c
Compare
sebasbad
marked this pull request as ready for review
August 2, 2026 20:11
sebasbad
marked this pull request as draft
August 15, 2026 19:46
…ces for llama.xcframework
sebasbad
marked this pull request as ready for review
August 15, 2026 20:33
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.
Summary
Restores CocoaPods compatibility alongside the newly added SwiftPM manifest (
Package.swift), adds universal multi-architecture Apple XCFramework slices (arm64andx86_64for simulator, device, and macOS), and ensures out-of-the-box reliability for both iOS and Android downstream Flutter consumers.Why Dual Support & Universal Binaries are Necessary
With
v0.9.0-dev.12introducing a SwiftPM manifest (Package.swift) while dropping.podspec, downstream Flutter iOS apps are forced into SwiftPM plugin resolution.However, many existing Flutter apps cannot fully migrate to SwiftPM because they depend on popular third-party plugins (such as
google_mobile_ads,google_mlkit_*, etc.) that currently support CocoaPods only and do not ship SwiftPM manifests. In these apps, Flutter's iOS build toolchain fails due to mixed package-manager collisions.Furthermore, developer workflows on Apple platforms require running across heterogeneous simulator environments (Apple Silicon M1-M4 Macs as well as Intel / Rosetta Macs).
Providing dual package manager support and universal binaries enables:
llama_cpp_dartseamlessly without breaking other CocoaPods plugins.arm64) and Intel (x86_64) can test on both physical hardware and simulators without linker architecture errors (Framework 'llama' not found).Changes Included
llama.xcframework:tool/build_apple_xcframework.sh: Enhanced build pipeline to compile andlipouniversal slices for:ios-arm64(Physical iPhone/iPad)ios-arm64_x86_64-simulator(Apple Silicon & Intel iOS Simulators)macos-arm64_x86_64(Universal macOS Desktop)llama_cpp.podspec: Addeds.prepare_commandto automatically download and unpack the prebuiltllama-xcframework.ziprelease asset duringpod installwhenbuild/apple/llama.xcframeworkis not present locally.llama_cpp_dart.podspec: Added CocoaPods specifications (darwin/,ios/, and root) pointing directly to the release xcframework asset.pubspec.yaml: SetpodspecPath: llama_cpp_dart.podspecunderiosandmacosplatform declarations.lib/src/ffi/library_loader.dart: EnhancedloadFromProcess()with candidate dylib/framework fallback paths to ensure robust symbol resolution across case-sensitive and case-insensitive Apple filesystem layouts.Supersedes
Supersedes #110.