我有一个有两种风格的应用程序(付费和免费)。我的框架之一叫做 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')
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索了一下,但我找不到如何解决这个问题。我尝试 * 在“链接二进制与库”构建阶段添加它,但这并没有解决它。* 将它添加到依赖项阶段,但它们没有出现在那里。* 将“构建设置 => 其他链接器标志”中的“-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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
非常感谢任何帮助/建议=)
小智 4
该错误仅发生在“产品”->“存档”中。
您可以在存档之前为单个目标安装 pod。
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!
def MyAppPods (scheme)
if scheme == 'MyAppFree'
pod 'AppBootstrap/FreeVersion'
end
if scheme == 'MyAppPaid'
pod 'AppBootstrap/PaidVersion'
end
end
workspace 'MyApp'
scheme = ENV['scheme']
if scheme
target scheme do
MyAppPods scheme
end
else
target 'MyAppFree' do
MyAppPods 'MyAppFree'
end
target 'MyAppPaid' do
MyAppPods 'MyAppPaid'
end
end
Run Code Online (Sandbox Code Playgroud)
scheme='MyAppFree' pod install
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7539 次 |
| 最近记录: |