use_frameworks! from your Podfile to use static libraries instead of dynamic frameworks, which reduces app launch time — especially noticeable with many dependencies. Run pod install after the change; some pods may still require frameworks.Why this happens
use_frameworks! forces CocoaPods to build every dependency as a dynamic framework. Historically this was mandatory because Swift could not consume static libraries — only Objective-C could. Each dynamic framework adds load-time overhead: the dynamic linker must locate, map, and bind every dylib before main() runs. On iOS 10–11 this overhead was significant; on modern iOS it still adds measurable milliseconds per framework.
Starting with Xcode 9 beta 4 and CocoaPods 1.5.0 (April 2018), the Swift compiler gained support for static libraries. Most pods now build correctly as static libraries, so the blanket use_frameworks! directive is often unnecessary and hurts startup performance.
How to fix it
1. Remove use_frameworks! and switch to static libraries (recommended)
Edit your Podfile and delete or comment out the line:
# use_frameworks!
platform :ios, '15.0'
target 'MyApp' do
pod 'Alamofire'
pod 'SwiftyJSON'
end
Run:
pod deintegrate
pod install
pod deintegrate cleans the old framework-based integration so the new static-library build starts clean. After pod install, open the .xcworkspace and build. App launch should be faster, especially on cold starts.
2. Keep use_frameworks! only for pods that require it
Some pods still need dynamic frameworks (e.g., they embed resources, use @objc plugins, or contain Swift-only code that doesn’t build statically). You can enable frameworks per-target or per-pod:
# Global static (default)
target 'MyApp' do
pod 'Alamofire'
pod 'SwiftyJSON'
# Only this pod needs dynamic framework
pod 'SomeLegacyPod', :frameworks => true
end
Or enable for a whole target:
target 'MyApp' do
use_frameworks! :linkage => :dynamic
pod 'PodThatNeedsDynamic'
end
3. Verify the linkage in the generated project
After pod install, select the Pods project → any pod target → Build Settings → Mach-O Type. It should show Static Library for most pods. Dynamic frameworks will show Dynamic Library.
How to prevent it
- Default new Podfiles to static libraries; add
use_frameworks!only when a specific pod fails to build. - Keep CocoaPods updated (
sudo gem install cocoapods) so new podspecs declare correct linkage. - Audit
Podfile.lockoccasionally:grep -c "framework" Podfile.lockgives a rough count of dynamic deps. - Set deployment target to iOS 12+; older iOS versions had worse dyld performance.
FAQ
Does removing use_frameworks! break Swift pods?
No. Since Swift 4.2 / Xcode 10, the compiler emits static libraries that Swift clients can link. The vast majority of popular pods (Alamofire, SwiftyJSON, Kingfisher, etc.) build and work as static libraries.
What if a pod fails to build after I remove it?
Re-add use_frameworks! for that specific pod using :frameworks => true (see fix #2). Check the pod’s GitHub issues — maintainers often tag releases that fix static linking.
Will app size change?
Static libraries are linked into the main binary, so the on-disk .ipa size may shrink slightly because you no longer ship separate .framework bundles. The main win is launch-time speed, not download size.
Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.
