
WatchKit扩展项目不需要我在我的正常目标中使用的很多框架,但是在改变我的Podfile后我无法使Cocoapods正常工作.
我用use_frameworks!在我的Podfile中,但在运行pod安装后,我收到以下消息:
[!] 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或Pods.release设置.没有基本配置的是WatchKit App.
我原来的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: 'git@github.com:xmartlabs/XLForm.git'pod 'Classy',git: 'git@github.com: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 endend
我改变了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/magicalpanda/MagicalRecord.git"pod 'UICKeyChainStore'target :HomeHandler do pod 'XLForm',git: 'git@github.com:xmartlabs/XLForm.git' pod 'UAProgressVIEw' pod 'Classy',git: 'git@github.com: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'endpost_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)','PURELAYOUT_APP_EXTENSIONS=1'] end end endend解决方法 CocoaPods输出的警告是由于两个CocoaPods目标试图链接到应用程序中的单个目标(不支持).
即,您有一个明确的目标HomeHandler,并且您使用link_with“HomeHandler”,“HomeHandler WatchKit Extension”将无名目标链接到HomeHandler.
我的建议是修改你的Podfile,看起来如下所示:
platform :ios,'8.0'use_frameworks!source 'https://github.com/artsy/Specs.git'source 'https://github.com/CocoaPods/Specs.git'def shared_pods 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'endtarget 'HomeHandler' do shared_pods pod 'XLForm',:git => 'https://github.com/depl0y/SwiftEventBus.git' pod 'PureLayout'endtarget 'HomeHandler WatchKit Extension' do shared_podsend总结
以上是内存溢出为你收集整理的ios – 在主目标中包含pod,而不在WatchKit扩展中全部内容,希望文章能够帮你解决ios – 在主目标中包含pod,而不在WatchKit扩展中所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)