Skip to content

fix: weak-link SwiftUICore to restore iOS 15/16 compatibility - #14

Merged
andredestro merged 1 commit into
mainfrom
fix/weak-link-SwiftUICore
Apr 20, 2026
Merged

fix: weak-link SwiftUICore to restore iOS 15/16 compatibility#14
andredestro merged 1 commit into
mainfrom
fix/weak-link-SwiftUICore

Conversation

@andredestro

Copy link
Copy Markdown
Collaborator

Description

Weak-link SwiftUICore.framework in 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.framework and SwiftUICore.framework. When this library is compiled with the iOS 17+ SDK, the linker creates a hard runtime dependency on SwiftUICore — even though all SwiftUI APIs used are compatible with iOS 14+. On iOS 15/16 devices, SwiftUICore doesn't exist, so dyld fails to load the app and it crashes immediately on launch.

Weak-linking makes SwiftUICore an optional load-time dependency. On iOS 15/16, dyld ignores 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

  • Fix (non-breaking change which fixes an issue)

Tests

Build the capacitor-camera example app targeting an iOS 15 simulator or device. Before this fix, the app crashed on launch with:

dyld: Library not loaded: /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore
Reason: tried: '...' (no such file)

After this fix, the app launches and operates normally on iOS 15/16 and retains full functionality on iOS 17+.

@andredestro
andredestro requested a review from a team April 20, 2026 09:59
@andredestro
andredestro force-pushed the fix/weak-link-SwiftUICore branch 2 times, most recently from 389386f to 0bf8e11 Compare April 20, 2026 10:40
@andredestro
andredestro marked this pull request as draft April 20, 2026 10:44
@andredestro
andredestro force-pushed the fix/weak-link-SwiftUICore branch from 0bf8e11 to ea8b356 Compare April 20, 2026 13:05
@andredestro
andredestro marked this pull request as ready for review April 20, 2026 13:56
@andredestro
andredestro merged commit dab3312 into main Apr 20, 2026
4 checks passed
@andredestro
andredestro deleted the fix/weak-link-SwiftUICore branch April 20, 2026 14:46
capacitor-bot pushed a commit that referenced this pull request Apr 20, 2026
## [1.0.1](1.0.0...1.0.1) (2026-04-20)

### Bug Fixes

* **ci:** remove npm cache from release workflow ([666219e](666219e))
* weak-link SwiftUICore to restore iOS 15/16 compatibility ([#14](#14)) ([dab3312](dab3312))
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.

[Bug]: 8.1.0 breaks support for iOS 15 due to requiring SwiftUiCore

2 participants