我正在尝试在podspec中的lib项目中安装“Google / Analytics”。
我的项目库是使用pod lib create with Swift创建的。
这是我的podspec:
s.source_files = 'Pod/Classes/**/*' s.resource_bundles = { 'LibPSLoginResources' => ['Pod/Resources/**/*.{xib,png,json}'] } s.dependency 'FBSDKCoreKit' s.dependency 'FBSDKLoginKit' s.dependency 'Google/Analytics' s.dependency 'Firebase/Auth' s.dependency 'Firebase/Core' s.dependency 'Firebase/Database'
我的PodFile:
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' inhibit_all_warnings! use_frameworks! target 'LibPSLogin_Example' do pod 'LibPSLogin', :path => '../' target 'LibPSLogin_Tests' do inherit! :search_paths end end
但是当总是运行pod install我得到这个: target具有包含静态二进制文件的传递依赖项:(/ Users / macprpr / Files / Project / iOS / LibsLogin / Example /Pods / Google / Library / libGGLAnalytics.a和/ Users / macpr / Documents / Projects / iOS / LibPSLogin / Example /荚/谷歌/库/ libGGLCore.a)
我已经尝试将此代码放入我的PodFile中,但无法通过.swift文件导入Google Analytics。
pre_install do |installer| def installer.verify_no_static_framework_transitive_dependencies; end end
据我所知,库项目无法导入静态库。但是我该怎么做才能解决这个问题呢? 任何人都可以帮助我吗?
由于
答案 0 :(得分:2)
您可能已经知道,由于Cocoapods 1.5,甚至可能是1.4,因此克服了臭名昭著的传递依赖问题成为可能。我的方法是现在可以使用静态框架方法,这意味着您不再需要使用#use_frameworks!在Podfile中,而是使用use_modular_headers!可以在介绍Cocoapods 1.5的博客文章中找到更多信息:http://blog.cocoapods.org/CocoaPods-1.5.0/
答案 1 :(得分:0)
据我所知,这对于这些图书馆来说是不可能的。几个星期前我遇到了同样的问题。
答案 2 :(得分:0)
您可以利用Carthage安装纯粹的Swift框架,就像我提出的回购一样:https://github.com/Lucashuang0802/CocoaPodsWithCarthage