4

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
5
  • Where does the GoogleUtilities dependency come from? I suspect the podspec is not declaring all of its dependencies. Commented May 24, 2020 at 14:10
  • @Paul Beusterien it comes from UserSDK dependency UserSDK.podspec. It downloaded when i run pod install
    – aseferov
    Commented May 24, 2020 at 14:35
  • Hmm, it sounds like the use_frameworks! :linkage => :static is not propagating properly through the vendored_framework for the GoogleUtilities build. Perhaps a CocoaPods bug ... Commented May 24, 2020 at 18:26
  • I tried without :linkage => :static and it is not working either, same error
    – aseferov
    Commented May 24, 2020 at 20:41
  • i'm wondering about the comment # 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?
    – blld
    Commented Jun 2, 2020 at 2:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.