我在当前项目中添加了 WatchKit 扩展。该项目使用Cocoapods0.36.1添加一些框架,但现在我想从 WatchKit 扩展项目中排除一些 pod。
WatchKit 扩展项目不需要我在正常目标中使用的很多框架,但在更改 Podfile 后我无法让 Cocoapods 正常工作。
I use use_frameworks!
在我的 Podfile 中,但是运行后pod install
我收到以下消息:
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HomeHandler` to `Pods/Target Support Files/Pods-HomeHandler/Pods-HomeHandler.debug.xcconfig` or include the `Pods/Target Support Files/Pods-HomeHandler/Pods-HomeHandler.debug.xcconfig` in your build configuration.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HomeHandler` to `Pods/Target Support Files/Pods-HomeHandler/Pods-HomeHandler.release.xcconfig` or include the `Pods/Target Support Files/Pods-HomeHandler/Pods-HomeHandler.release.xcconfig` in your build configuration.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HomeHandler WatchKit Extension` to `Pods/Target Support Files/Pods-HomeHandler WatchKit Extension/Pods-HomeHandler WatchKit Extension.debug.xcconfig` or include the `Pods/Target Support Files/Pods-HomeHandler WatchKit Extension/Pods-HomeHandler WatchKit Extension.debug.xcconfig` in your build configuration.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `HomeHandler WatchKit Extension` to `Pods/Target Support Files/Pods-HomeHandler WatchKit Extension/Pods-HomeHandler WatchKit Extension.release.xcconfig` or include the `Pods/Target Support Files/Pods-HomeHandler WatchKit Extension/Pods-HomeHandler WatchKit Extension.release.xcconfig` in your build configuration.
我没有更改基本配置的任何设置,但我的 3 个目标中有 2 个具有正确的设置Pods.debug
or Pods.release
放。没有基础配置的是WatchKitApp.
我原来的 Podfile
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git'
pod 'CocoaLumberjack', '~> 2.0.0'
pod 'MagicalRecord', :git => "https://github.com/magicalpanda/MagicalRecord.git"
pod 'PureLayout'
pod 'UAProgressView'
pod 'UICKeyChainStore'
pod 'XLForm', git: '[email protected] /cdn-cgi/l/email-protection:xmartlabs/XLForm.git'
pod 'Classy', git: '[email protected] /cdn-cgi/l/email-protection:depl0y/Classy.git'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'JBChartView', '~> 2.8.9'
pod 'RFQuiltLayout'
pod 'HUMSlider', '~> 1.0'
pod 'SwiftEventBus', :git => 'https://github.com/cesarferreira/SwiftEventBus.git'
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == "Pods-AFNetworking"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'AF_APP_EXTENSIONS=1']
end
end
if target.name == "Pods-PureLayout"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'PURELAYOUT_APP_EXTENSIONS=1']
end
end
end
end
我修改过的 Podfile
这是我想从我的 WatchKit 项目中排除某些 pod 的地方。
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
link_with "HomeHandler", "HomeHandler WatchKit Extension"
pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git'
pod 'CocoaLumberjack', '~> 2.0.0'
pod 'MagicalRecord', :git => "https://github.com/magicalpanda/MagicalRecord.git"
pod 'UICKeyChainStore'
target :HomeHandler do
pod 'XLForm', git: '[email protected] /cdn-cgi/l/email-protection:xmartlabs/XLForm.git'
pod 'UAProgressView'
pod 'Classy', git: '[email protected] /cdn-cgi/l/email-protection:depl0y/Classy.git'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']
pod 'JBChartView', '~> 2.8.9'
pod 'RFQuiltLayout'
pod 'HUMSlider', '~> 1.0'
pod 'SwiftEventBus', :git => 'https://github.com/depl0y/SwiftEventBus.git'
pod 'PureLayout'
end
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
if target.name == "Pods-AFNetworking"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'AF_APP_EXTENSIONS=1']
end
end
if target.name == "Pods-PureLayout"
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = ['$(inherited)', 'PURELAYOUT_APP_EXTENSIONS=1']
end
end
end
end