不使用use_frameworks时出现“ dyld:库未加载”错误

时间:2018-08-23 10:42:19

标签: ios swift cocoapods

我有一个名为XXCommonUtils的私人吊舱,该吊舱通过Cocoapods EDSunriseSet安装了一个依赖项。

我的私人Pod的podspec如下

Pod::Spec.new do |s|
  s.name = "XXCommonUtils"
  s.module_name = 'XXCommonUtils'
  s.version = "2.0.2"
  s.summary = "XX CommonUtils Component"
  s.homepage = 'https://www.xx.com'
  s.license = { :type => "Private", :text => "Copyright 2016-2018 by XX. All right reserved." }
  s.author = { "XX XX" => "xx.xx@xx.com" }
  s.source = { :git => "https://github.xx.com/TSS-XX-CoreApp/iOS-Stage-Frameworks", :tag => "XXCommonUtils-2.0.2-Beta" }
  s.swift_version = '4.1.2'
  s.platform = :ios, '8.0'
  s.requires_arc = true
  s.ios.vendored_frameworks = 'XXCommonUtils/XXCommonUtils.framework'
  s.frameworks = 'UIKit', 'CoreData'
  s.dependency 'EDSunriseSet', '1.0'
end

您可以在此处看到EDSunriseSet依赖项。

我正在使用以下Podfile将此私有Pod导入到应用程序中

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.xx.com/TSS-XX-CoreApp/iOS-Stage-CocoaPods.git'


target 'netperf01' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    #  use_frameworks!

    pod 'XXCommonUtils', '2.0.2'

    # Pods for netperf01

    target 'netperf01Tests' do
        inherit! :search_paths
        # Pods for testing
    end

end

我看到Pod安装输出中同时安装了公共utils私有pod及其依赖项EDSunriseSet。

运行应用程序时,我立即因该错误而崩溃

dyld: Library not loaded: @rpath/EDSunriseSet.framework/EDSunriseSet

Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/CF8F6C93-2BCF-44F5-B5D1-8B567777271A/data/Containers/Bundle/Application/9E462A24-0417-494F-9081-77D9A33C3B7D/netperf01.app/Frameworks/XXCommonUtils.framework/XXCommonUtils
  Reason: image not found

如果我取消对应用程序Podfile中的# use_frameworks!的注释,则该应用程序将正常运行,但是不幸的是,这不适用于尝试使用XXCommonUtils库的客户端。还有另一种解决此问题的方法吗?

0 个答案:

没有答案