fix: weak-link SwiftUICore to restore iOS 15/16 compatibility - #14
Merged
Conversation
andredestro
force-pushed
the
fix/weak-link-SwiftUICore
branch
2 times, most recently
from
April 20, 2026 10:40
389386f to
0bf8e11
Compare
andredestro
marked this pull request as draft
April 20, 2026 10:44
andredestro
force-pushed
the
fix/weak-link-SwiftUICore
branch
from
April 20, 2026 13:05
0bf8e11 to
ea8b356
Compare
andredestro
marked this pull request as ready for review
April 20, 2026 13:56
OS-pedrogustavobilro
approved these changes
Apr 20, 2026
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.
Description
Weak-link
SwiftUICore.frameworkin both SPM (Package.swift) and CocoaPods (IONCameraLib.podspec) to fix a crash on launch affecting iOS 15 and 16 devices.Context
Since iOS 17, Apple split SwiftUI into two frameworks:
SwiftUI.frameworkandSwiftUICore.framework. When this library is compiled with the iOS 17+ SDK, the linker creates a hard runtime dependency onSwiftUICore— even though all SwiftUI APIs used are compatible with iOS 14+. On iOS 15/16 devices,SwiftUICoredoesn't exist, sodyldfails to load the app and it crashes immediately on launch.Weak-linking makes
SwiftUICorean optional load-time dependency. On iOS 15/16,dyldignores its absence and the app starts normally; on iOS 17+, the framework is present and loaded as usual — no behavioural change.Fixes: ionic-team/capacitor-camera#44
Type of changes
Tests
Build the
capacitor-cameraexample app targeting an iOS 15 simulator or device. Before this fix, the app crashed on launch with:After this fix, the app launches and operates normally on iOS 15/16 and retains full functionality on iOS 17+.