I need to ship a compiled framework - let's call it Abc.framework with cocoapods.
This framework has some dependencies - let's assume I need Nomosi and KeychainSwift.
Podfile:
platform :ios, '10.0'
use_frameworks!
target 'Abc' do
pod "Nomosi", "0.1.2"
pod "KeychainSwift", "18.0"
end
I'm able to build a fat framework using a script like this.
Podspec:
Pod::Spec.new do |s|
s.name = 'Abc'
s.version = '0.0.1'
s.summary = 'Abc description.'
s.description = 'Abc looong description.'
s.homepage = 'https://test.com'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Author' => 'me@test-email.com' }
s.source = { :git => 'https://github.com/test/this-is-not-a-repo.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.public_header_files = "Build/Abc.framework/Headers/*.h"
s.source_files = "Build/Abc.framework/Headers/*.h"
s.vendored_frameworks = 'Build/Abc.framework'
s.dependency 'KeychainSwift', '18.0'
s.dependency 'Nomosi', '0.1.2'
end
Now if I create a demo project using the local pod it compiles but there's a runtime crash:
dyld: Symbol not found: _$s6Nomosi15ServiceResponseP5parse4dataxSg10Foundation4DataV_tKFZTq
Referenced from: /Users/mario/Library/Developer/CoreSimulator/Devices/DFF39FE4-F274-4E4E-9710-AB24B043CFB0/data/Containers/Bundle/Application/A9C811DE-19D6-4535-996B-B5F2D142D691/AbcDemo.app/Frameworks/Abc.framework/Abc
If the podspec points to the actual source code (instead of shipping the compiled fat framework) the app doesn't crash.
This is probably related to some linking error in the framework (@rpath?) but I really don't know how to fix it.