2017-04-25 33 views
3

我想製作一個動態框架,將兩個第三方框架與靜態庫合併在一起,然後將其作爲一個窗格添加到我的項目中。 這裏是他們podspec文件如何使用Cocoapods基於兩個靜態庫製作一個動態框架(Swift)

我想他們在我podspec文件添加爲s.dependency但得到以下錯誤 Pods error - target has transitive dependencies that include static binaries

試圖將它們包括爲s.vendored_frameworks但是得到了以下https://github.com/CocoaPods/CocoaPods/issues/6409並且不能對給定的解決方案進行解決。

請問您可以幫我指導我如何處理它,稍後我會發布一些測試項目以更仔細地觀察問題。現在我只有很多不同的測試項目不能工作,我甚至不知道要發佈到Github上的內容。

在我的大多數嘗試中,我最終無法在我的框架swift文件中使用Import IndoorsSDK/IndoorAtlas,因爲「沒有這樣的模塊」錯誤。

感謝任何幫助。

回答

2

最後,我找到了解決方案。所以,如果有人遇到類似的問題,我在這裏發佈。

podspec文件除了其他行包含以下

#// one library added as dependency, another as vendored_frameworks 
#// because it lacks modulemap, so it was added manually to IndooRS framework 
spec.dependency 'IndoorAtlas' 
spec.vendored_frameworks = 'SKNavigation/Frameworks/IndoorsSDK.framework' 

#// following lines fix linking issues so our pod would see dependency modules 
spec.pod_target_xcconfig = { 
    'FRAMEWORK_SEARCH_PATHS' => '$(inherited) $(SRCROOT)/**', 
    'OTHER_LDFLAGS' => '$(inherited) -undefined dynamic_lookup' 
    } 

而且modulemap,已添加到,缺乏它

module IndoorsSDK [system] { 
    header "Headers/IndoorsSDK.h" 
    header "Headers/Indoors.h" 
    export * 
    link framework "CoreMotion" 
    link framework "CoreBluetooth" 
    link "c++" 
} 

最新點框架,podfile應包含以下內容以隱藏傳遞依賴關係錯誤。

pre_install do |installer| 
    def installer.verify_no_static_framework_transitive_dependencies; end 
end 

而這可能就是全部。

相關問題