我有一个应用程序有两个版本(付费版和免费版)。我的框架之一称为AppBootstrap,它有两个子规格(FreeVersion和PaidVersion)
现在Xcode一直在发出这个讨厌的警告(我希望在我的项目中达到零个警告,所以我不想忽略它,因为那样会让人滑向悬崖 ;) )
Multiple targets match implicit dependency for product reference 'AppBootstrap.framework'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'The Flight Tracker Free' from project 'The Flight Tracker')
Target 'AppBootstrap-FreeVersion' (in project 'AppBootstrap')
Target 'AppBootstrap-PaidVersion' (in project 'AppBootstrap')
我在谷歌上搜了一下,但找不到解决方法。 我尝试过: * 将其添加到“链接二进制文件与库”构建阶段,但没有解决问题。 * 将其添加到依赖项阶段,但它们在那里不显示。 * 在“构建设置=>其他链接器标志”中将“-framework AppBootstrap”更改为“-framework AppBootstrap-FreeVersion”,但结果出现错误。
我的podfile(简化)
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
AppBootstrap Podspec
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
非常感谢您的帮助和建议 =)