Question: I have created a workspace containing a SwiftUI app and two frameworks:
B Framework: Handles UI components C Framework: Handles service classes I added a Podfile to manage dependencies. My Podfile is structured as follows:
inhibit_all_warnings!
workspace 'ABC.xcworkspace'
def shared_pods
# Shared pods here
pod 'Alamofire'
end
target 'A' do
use_frameworks!
project 'A/A.xcodeproj'
shared_pods
end
target 'B' do
use_frameworks!
project 'B/B.xcodeproj'
shared_pods
end
target 'C' do
use_frameworks!
project 'C/C.xcodeproj'
shared_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
After installing pods and building the project, everything works fine except for Xcode’s SwiftUI Preview, which crashes with the following error:
xcpreviewagent crashed because Alamofire.framework is missing
Question: How can I resolve this issue and make SwiftUI Previews work without Xcode crashing?