I have project MySingleViewApp and framework MyFramework. Both are fresh created xcode projects and just added podfile to MySingleViewApp and podspec file to MyFramework.
this is MySingleVIewApp pod file;
target 'MySingleVIewApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks! :linkage => :static
pod 'MyFramework', :path => '../MyFramework'
target 'MySingleVIewAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MySingleVIewAppUITests' do
# Pods for testing
end
end
And this is MyFramework podspec file
Pod::Spec.new do |s|
s.name = "MyFramework"
s.version = "1.0.0"
s.summary = "bla"
s.description = <<-DESC
some description
DESC
s.homepage = "https://github.com/github_account/my-framework"
# brief license entry:
s.license = "MIT"
# optional - use expanded license entry instead:
# s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "Your Name" => "[email protected]" }
s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/github_account/my-framework.git", :tag => "#{s.version}" }
s.requires_arc = true
s.swift_version = "5.1.2"
s.vendored_frameworks = 'MyFramework.framework'
s.static_framework = true
s.dependency "UserSDK"
end
When run MySingleVIewApp project i get error
dyld: Library not loaded: @rpath/GoogleUtilities.framework/GoogleUtilities Referenced from: Frameworks/UserSDK.framework/UserSDK Reason: image not found
If i add UserSDK(which is spec dependency of MyFramework) and remove MyFramework from podfile it works
target 'MySingleVIewApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks! :linkage => :static
pod 'UserSDK'
target 'MySingleVIewAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MySingleVIewAppUITests' do
# Pods for testing
end
end
use_frameworks! :linkage => :static
is not propagating properly through the vendored_framework for the GoogleUtilities build. Perhaps a CocoaPods bug ...:linkage => :static
and it is not working either, same error# Comment the next line if you don't want to use dynamic frameworks
. sounds like you just changed dynamic to static, where you should have commented the whole thing?