Overview
Theframeworks option in expo-target.config.js allows you to link Apple’s system frameworks to your target. This gives you access to native iOS capabilities like SwiftUI, WidgetKit, CloudKit, and more.
Basic Usage
Add frameworks to your target configuration:Default Frameworks
Many target types include frameworks automatically based on their functionality:Widget Extensions
Widget Extensions
Watch Apps
Watch Apps
Safari Extensions
Safari Extensions
Network Extensions
Network Extensions
Common Frameworks
Here are frequently used frameworks and their purposes:UI Frameworks
Widget & Control Frameworks
Data & Storage
Media & Graphics
Networking & Services
Device Features
Example: Widget with CloudKit
A widget that syncs data via iCloud:Example: App Intent Extension
An App Intent for Siri shortcuts:Example: Photo Editing Extension
A photo filter extension:Framework Requirements
Version Compatibility
Frameworks are version-specific. Check availability:Linking Behavior
How frameworks are linked
How frameworks are linked
When you specify frameworks, the plugin:
- Adds the framework to the target’s “Link Binary with Libraries” build phase
- Sets the appropriate framework search paths
- Configures the linker flags
- Handles both system frameworks and custom frameworks
Required vs Optional linking
Required vs Optional linking
By default, frameworks are required. If a framework isn’t available at runtime, the app crashes.For optional frameworks:The Swift compiler handles this automatically for system frameworks.
Custom Framework Files
You can also link custom.framework bundles:
libs/ directory and reference them by relative path.
Dynamic Configuration
Use a function to conditionally add frameworks:Debugging Framework Issues
Framework not found at runtime
Framework not found at runtime
Check:
- The framework name is spelled correctly
- The framework is available on your deployment target version
- You’ve run
npx expo prebuild --cleanafter adding it - The framework appears in Xcode under Target > Build Phases > Link Binary with Libraries
Build errors about missing symbols
Build errors about missing symbols
You may need additional frameworks:This means you’re using CloudKit but haven’t added the framework:
Runtime crashes on older iOS versions
Runtime crashes on older iOS versions
The framework might not be available on your minimum deployment target:Or use availability checks:
Performance Considerations
- Lazy loading: Frameworks are loaded on first use (for Swift frameworks)
- Binary size: Each framework adds to your app’s download size
- Startup time: Many frameworks can slow app launch
Next Steps
- Learn about CocoaPods integration for third-party dependencies
- Explore target types and their default frameworks
- Set up shared files between targets
- Check troubleshooting for common framework issues