首页 > 解决方案 > 将 POD 文件更新为与其包含的项目相同的构建设置

问题描述

我是一名初级开发者,继承了公司的 iOS 应用。我无权访问建造它的人。

我们升级到 Xcode 11.2 和 Swift 5。这引起了依赖问题的连锁反应,这是意料之中的。最大的问题是我们使用的是 Facebook SDK,而我们使用的版本不支持 iOS 13。所以我从 podfile 中删除了 FBSDKCoreKit 和 FBSDKLoginKit,运行“pod install”,将它们添加回 podfile,运行“pod install” ' 再次。我修复了不推荐使用的代码,一切都很好。

然而,我们的视频播放器的 pod 坏了,出现了十几个不推荐使用/重命名的函数错误。这个 Pod,VGPlayer,是由我们之前的开发人员分叉到他自己的 repo 中的,在那里他对其进行了更改。所以我再次将它从他的仓库分叉到我们公司的仓库,我的想法是修复损坏的东西,然后将其重新导入主项目。

我遇到的问题是,当我克隆存储库并在 Xcode 中打开它时,一切正常。当我将 pod 导入主项目时,所有不推荐使用/重命名的方法都很好,并且可以完美构建。所以我猜测 pod 和主项目使用不同的构建设置,但我不知道有什么不同。他们都使用 Swift 5.0 版,他们都有 iOS 11 的部署目标。

这里有什么建议吗?

platform :ios, '10.0'
use_frameworks!
inhibit_all_warnings!

def sharedPods

    # Wrapper 
    pod 'KeychainAccess'

    # Reporting tools
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Firebase'
    pod 'Firebase/Core'
    pod 'Firebase/Performance'
    pod 'Analytics'
    pod 'Intercom'
    pod 'FBSDKCoreKit'

    # Models
    pod 'FastEasyMapping'

    # UI Components
    pod 'MXSegmentedControl', :git => 'git@github.com:vesterio/MXSegmentedControl.git', :branch => 'master'
    pod 'SDWebImage'
    pod 'Presentr'
    pod 'lottie-ios'
    pod 'AloeStackView'
    pod 'VGPlayer', :git => 'git@github.com:vesterio/VGPlayer.git', :branch => 'master'

    pod 'IGListKit'
    pod 'FBSDKLoginKit'
    pod 'SwiftGen'

    pod 'SAConfettiView', :git => 'git@github.com:vesterio/SAConfettiView.git', :branch => 'master'

end

target 'Tests' do
    use_frameworks!
    sharedPods

    # Testing
    pod 'Nimble'
    pod 'Quick'
end

target 'Monner' do
    sharedPods
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        plist_buddy = "/usr/libexec/PlistBuddy"
        plist = "Pods/Target Support Files/#{target}/Info.plist"
        `#{plist_buddy} -c "Add UIRequiredDeviceCapabilities array" "#{plist}"`
        `#{plist_buddy} -c "Add UIRequiredDeviceCapabilities:0 string arm64" "#{plist}"`
    end
end

标签: iosswiftcocoapods

解决方案


推荐阅读