Xcode警告:多个目标匹配产品的隐式依赖项

Xcode警告:多个目标匹配产品的隐式依赖项,xcode,cocoapods,Xcode,Cocoapods,我有一个应用程序,有两种风格(付费和免费)。我的一个框架叫做AppBootstrap,它有两个子服务器(FreeVersion和PaidVersion) 现在Xcode一直在给出这个恼人的警告(我的目标是在我的项目中实现零警告,所以我不想忽视它,滑倒等等;) 我在谷歌上搜索了一下,但我找不到如何解决这个问题。 我试过了 *在“将二进制文件与库链接”的构建阶段添加它,但这并没有解决它。 *将其添加到依赖项阶段,但它们不会显示在那里。 *将“Build settings=>其他链接器标志”中的“-f

我有一个应用程序,有两种风格(付费和免费)。我的一个框架叫做AppBootstrap,它有两个子服务器(FreeVersion和PaidVersion)

现在Xcode一直在给出这个恼人的警告(我的目标是在我的项目中实现零警告,所以我不想忽视它,滑倒等等;)

我在谷歌上搜索了一下,但我找不到如何解决这个问题。 我试过了 *在“将二进制文件与库链接”的构建阶段添加它,但这并没有解决它。 *将其添加到依赖项阶段,但它们不会显示在那里。 *将“Build settings=>其他链接器标志”中的“-framework-AppBootstrap”更改为“-framework-AppBootstrap-FreeVersion”,但这只会导致错误

我的播客文件(简化)

AppBootstrap播客规范

Pod::Spec.new do |s|
    s.name        = 'AppBootstrap'
    s.version     = '3.18.2'
    s.summary     = 'iOS App Bootstrap Module.'
    s.platforms   = { ios: '9.0' }
    s.swift_version = '5.0'

    s.description = <<-DESC
        Contains classes to bootstrap ios apps.
    DESC

    s.homepage = ---
    s.license  = { type: 'MIT', file: 'LICENSE' }
    s.author   = { --- }
    s.source   = { --- }

    s.frameworks = [
        'Foundation',
        'UIKit'
    ]


    s.subspec 'PaidVersion' do |sub|
        sub.dependency 'Advertisement/Core'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"PAIDVERSION"'
        }
    end

    s.subspec 'FreeVersion' do |sub|
        sub.dependency 'Advertisement/Ads'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets',
            'AppBootstrap/support/Colors.xcassets',
            'AppBootstrap/support/Fonts/*.otf'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"FREEVERSION"'
        }
    end

    s.subspec 'Undefined' do |sub|
        sub.dependency 'Advertisement/Core'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets',
            'AppBootstrap/support/Fonts/*.otf'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"UNDEFINEDVERSION"'
        }
    end

    s.default_subspec = 'Undefined'
end
Pod::Spec.new do|s|
s、 名称='AppBootstrap'
s、 版本='3.18.2'
s、 summary='iOS应用程序引导模块。'
s、 平台={ios:'9.0'}
s、 swift_版本='5.0'
s、 description='-D“PAIDVERSION”'
}
结束
s、 子类“自由版本”do |子类|
子依赖项“广告/广告”
sub.source_文件=[
“AppBootstrap/source/***/.swift”
]
次级资源=[
“AppBootstrap/support/Localization/*.lproj”,
“AppBootstrap/support/approvertext.plist”,
“AppBootstrap/support/Images.xcsets”,
“AppBootstrap/support/Colors.xcsets”,
“AppBootstrap/support/font/*.otf”
]
sub.pod_target_xcconfig={
“仅应用程序扩展\u API”=>“否”
}
sub.pod_target_xcconfig={
'其他快捷标志'=>'-D“自由版本”'
}
结束
s、 子类“未定义”do |子类|
子依赖项“广告/核心”
sub.source_文件=[
“AppBootstrap/source/***/.swift”
]
次级资源=[
“AppBootstrap/support/Localization/*.lproj”,
“AppBootstrap/support/approvertext.plist”,
“AppBootstrap/support/Images.xcsets”,
“AppBootstrap/support/font/*.otf”
]
sub.pod_target_xcconfig={
“仅应用程序扩展\u API”=>“否”
}
sub.pod_target_xcconfig={
'其他快捷标志'=>'-D“未定义版本”'
}
结束
s、 默认_子类=‘未定义’
结束

非常感谢任何帮助/建议=)

错误只发生在Pruduct->Archive中

您可以在归档之前为单个目标进行pod安装

源代码“自定义播客/链接”
来源'https://cdn.cocoapods.org/'
平台:ios,“9.0”
安装椰子荚,
:生成多个项目=>true,
:增量安装=>true
使用你的框架!
禁止所有警告!
def MyAppPods(方案)
如果方案=='MyAppFree'
pod“AppBootstrap/FreeVersion”
结束
如果方案==“MyAppPaid”
pod“AppBootstrap/PaidVersion”
结束
结束
工作区“MyApp”
scheme=ENV['scheme']
if方案
目标计划
MyAppPods计划
结束
其他的
目标“MyAppFree”do
MyAppPods“MyAppFree”
结束
目标“MyAppPaid”是什么
MyAppPods“MyAppPaid”
结束
结束
scheme='MyAppFree'吊舱安装

当我在Podfile中升级iOS-min版本,但忘记在Podfile中升级框架(目标)时,我遇到了这种情况

一个简单的修复方法是不使用
subsec
。相反,创建两个不同的规格。 e、 g


你找到解决办法了吗?还没有[还需要八个字符…]
source 'custom-pods/link'
source 'https://cdn.cocoapods.org/'

platform :ios, '9.0'

install! 'cocoapods',
  :generate_multiple_pod_projects => true,
  :incremental_installation => true

use_frameworks!
inhibit_all_warnings!

workspace 'MyApp'

target 'MyAppFree' do
  pod 'AppBootstrap/FreeVersion'
end

target 'MyAppPaid' do    
  pod 'AppBootstrap/PaidVersion'
end
Pod::Spec.new do |s|
    s.name        = 'AppBootstrap'
    s.version     = '3.18.2'
    s.summary     = 'iOS App Bootstrap Module.'
    s.platforms   = { ios: '9.0' }
    s.swift_version = '5.0'

    s.description = <<-DESC
        Contains classes to bootstrap ios apps.
    DESC

    s.homepage = ---
    s.license  = { type: 'MIT', file: 'LICENSE' }
    s.author   = { --- }
    s.source   = { --- }

    s.frameworks = [
        'Foundation',
        'UIKit'
    ]


    s.subspec 'PaidVersion' do |sub|
        sub.dependency 'Advertisement/Core'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"PAIDVERSION"'
        }
    end

    s.subspec 'FreeVersion' do |sub|
        sub.dependency 'Advertisement/Ads'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets',
            'AppBootstrap/support/Colors.xcassets',
            'AppBootstrap/support/Fonts/*.otf'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"FREEVERSION"'
        }
    end

    s.subspec 'Undefined' do |sub|
        sub.dependency 'Advertisement/Core'

        sub.source_files = [
            'AppBootstrap/source/**/*.swift'
        ]

        sub.resources = [
            'AppBootstrap/support/Localization/*.lproj',
            'AppBootstrap/support/ConsentText.plist',
            'AppBootstrap/support/Images.xcassets',
            'AppBootstrap/support/Fonts/*.otf'
        ]

        sub.pod_target_xcconfig = {
            'APPLICATION_EXTENSION_API_ONLY' => 'NO'
        }

        sub.pod_target_xcconfig = {
            'OTHER_SWIFT_FLAGS' => '-D"UNDEFINEDVERSION"'
        }
    end

    s.default_subspec = 'Undefined'
end
target 'MyAppFree' do
  pod 'AppBootstrapFreeVersion'
end

target 'MyAppPaid' do    
  pod 'AppBootstrapPaidVersion'
end