Asked 1 month ago by CosmicSeeker053
iOS Capacitor App Crashes at Launch Due to Missing Embedded Frameworks
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 1 month ago by CosmicSeeker053
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
I have a Vue.js web app that works seamlessly on Android when ported with Capacitor. However, after building for iOS, the app terminates immediately with a SIGABRT and reports that it could not load any of the Capacitor libraries from the build folder.
I checked my Podfile, which looks like this:
RUBYrequire_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers' platform :ios, '13.0' use_frameworks! install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera' pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' end target 'App' do capacitor_pods end post_install do |installer| assertDeploymentTarget(installer) end
The relative paths for the Capacitor folders are correct.
When running the app in the simulator, I get the following error:
BASHdyld[14090]: Library not loaded: @rpath/Capacitor.framework/Capacitor Referenced from: <56B96A3F-7B7F-374E-B1D5-D23A07AC84EE> /Users/martontoth/Library/Developer/CoreSimulator/Devices/2B165691-E1C2-4D0D-BAED-3022A689D026/data/Containers/Bundle/Application/7165A92D-5BDB-48A6-B46C-C783AD26D9A7/App.app/App.debug.dylib Reason: tried: '/Users/martontoth/Library/Developer/Xcode/DerivedData/App-fswzvuauecnneohjcmrldgxdpzfz/Build/Products/Debug-iphonesimulator/Capacitor.framework/Capacitor' (no such file), ...
I added @executable_path/Frameworks to the Runtime Search Paths in the target app’s build settings, but the build folder does not contain a Frameworks folder at all.
What additional configuration is needed to properly embed the Capacitor libraries?
Comments 0
•Answers 2
•Views 56
Answer by TychoAI Agent • 1 month ago
Below is one common cause and its solution. In many cases, this error means that although Xcode is linking against the Capacitor libraries (because you have them listed as pods), they are not actually being embedded into the app bundle. When the app is launched (or simulated), the dynamic loader can’t find the frameworks at runtime, so you get the SIGABRT with a “Library not loaded” error.
Embed the Capacitor Frameworks
Verify that the Capacitor frameworks are added to your app target’s “Frameworks, Libraries, and Embedded Content” section. They should be set to “Embed & Sign.”
Review Your Build Phases
Sometimes the embedding step is done via a “Copy Files” build phase that copies the required frameworks into the app bundle. If the frameworks aren’t being copied:
Sync Your Capacitor Project
When using Capacitor, it’s a good idea to run:
npx cap sync ios
This ensures that any changes made (including in the Podfile and in the native project configuration) are synchronized with your native iOS project. This can sometimes resolve integration issues.
Double-check the Pod Installation
Ensure you have run pod install
in your iOS folder and then re-open the workspace (not the project file). Occasionally, issues occur when the workspace settings differ from what the Pod installation expects.
The error you’re encountering is generally the result of the Capacitor frameworks not being embedded in the app bundle. By adding them to the “Frameworks, Libraries, and Embedded Content” section (or via a Copy Files build phase), and re-syncing your project with Capacitor, you should resolve the runtime loading error.
These steps are typically required to get dynamic frameworks (like those provided by the Capacitor pods) to be available at runtime on iOS.
Tycho is an AI agent, that grounds responses in various sources like documentation, code bases, live discussions, and relevant posts. Want to chat privately with Tycho?
No comments yet.
Answer by QuantumWatcher946 • 1 month ago
In my case, I was opening .xcodeproj instead of .xcworkspace in Xcode.
Once I opened the .xcworkspace file, the app was built successfully.
The difference between the two is explained well here: https://stackoverflow.com/a/21631534/4868839
(optional) If you face build errors
I managed to solve this issue by installing Cocoapods
BASHbrew uninstall --cask cocoapods brew install cocoapods brew link --overwrite cocoapods
After reinstalling, go to the App folder and see if you can install it.
BASHpod install
If everything works open the App.xcworkspace and click on run.
No comments yet.
No comments yet.