ios - 多个命令产生错误 - Cocoapods 多个目标和平台

标签 ios swift cocoapods xcode10 ios12

我正在构建一个 iOS 应用程序,我想使用最新的 Siri 快捷方式进行更新,在设备上构建和测试时一切正常,但在存档时出现错误。

这是我遇到的错误:

error: Multiple commands produce '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework':
1) Target 'Alamofire-iOS12.0' has create directory command with output '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework'
2) Target 'Alamofire-iOS10.0' has create directory command with output '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Alamofire.framework'

我有 4 个这样的错误,看起来都一样,但 Pod 不同。

多平台是可以解释的,因为主要项目平台从 iOS 10.0 开始,但对于 Siri 快捷方式 Intent 和 Intent UI,我需要使用平台 iOS 12.0。这似乎仍然存在问题。

这是我的 Pod 文件:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://bitbucket.org/company/company-specs.git'

def sharedPods
  pod 'Alamofire'
  pod 'AlamofireObjectMapper'
  pod 'KeychainSwift'
  pod 'ObjectMapper'
end

target 'Project' do
    platform :ios, '10.0'

    use_frameworks!

    sharedPods

    pod 'AlignedCollectionViewFlowLayout', :git => 'https://github.com/mischa-hildebrand/AlignedCollectionViewFlowLayout.git'
    pod 'Crashlytics'
    pod 'Charts', '3.0.4'
    pod 'Device.swift'
    pod 'Fabric'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'ImageSlideshow', '~> 1.3'
    pod 'Kanna', :git => 'https://github.com/tid-kijyun/Kanna.git', :branch => 'feature/v4.0.0'
    pod 'MagicalRecord', '2.3.2'
    pod 'CompanySupportLib', '1.1.3'
    pod 'Starscream'
    pod 'SwiftSVG', '~> 2.0'
    pod 'VPAttributedFormat', '1.2.5'
    pod 'youtube-ios-player-helper', '0.1.6'

    target 'ProjectTests' do
        inherit! :search_paths

        pod 'Firebase'
    end
end

target 'Project WatchOS Extension' do
    platform :'watchos', '3.0'

    use_frameworks!

    sharedPods
end

target 'Project Today' do
    platform :ios, '10.0'

    use_frameworks!

    sharedPods
end

target 'Project Intent' do
    platform :ios, '12.0'

    use_frameworks!

    sharedPods
end

target 'Project IntentUI' do
    platform :ios, '12.0'

    use_frameworks!

    sharedPods
end

target 'Project Own Framework' do
    platform :ios, '10.0'

    use_frameworks!

    sharedPods
end

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
            config.build_settings['SWIFT_VERSION'] = '4.0'
            if config.build_settings['SDKROOT'] == 'watchos'  
              config.build_settings['WATCHOS_DEPLOYMENT_TARGET'] = '4.0'  
            end
        end
    end
end  

最佳答案

我发现对于 Siri 快捷方式,Intents 和 IntentsUI 目标不需要 platform :ios, '12.0' 所以当我将其更改为 platform :ios, '10.0' 它删除了重复的框架目标并修复了存档问题。

关于ios - 多个命令产生错误 - Cocoapods 多个目标和平台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52943848/

相关文章:

ios - 使用全局变量和常量是一种好习惯吗? ( swift 5)

iOS 将 subview 带回

android - 如何在 Visual Studio 2019-Pre 之外调试应用程序?

ios - swift 3 : Error: Type 'Any' has no subscript member

ios - 命令/bin/sh 失败,退出代码为 133 - CocoaPods 错误 macOS Sierra

ios - 谷歌地图上未显示注释或标记

ios - Swift 准备被 TabBarController 打断的 segue

ios - 在 swift 的 navigationStack 之上重用相同的 viewController

ios - 将 Playground 添加到现有工作区(使用 cocoapods)

ios - 创建使用外部 Pod 的自定义 Pod