2015-03-28 14 views
8

Geçerli projeme bir WatchKit uzantısı ekledim. Proje bazı çerçeveler eklemek için Cocoapods 0.36.1 kullanır, ancak şimdi bazı bölmeleri WatchKit uzantı projesinden çıkarmak istiyorum.Ana hedefe bölmeleri dahil et ve WatchKit uzantısında değil

WatchKit uzantı projesinin normal hedefimde kullandığım birçok çerçeveye ihtiyacı yoktur, ancak Pod Dosyası'mı değiştirdikten sonra doğru çalışmak için Cocoapod'ları alamıyorum.

benim Podfile içinde use_frameworks! kullanıyorum ama şu mesajları almak pod install çalıştırdıktan sonra: benim 3 hedeflerin

[!] 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. 

benim taban yapılandırmaları için herhangi bir ayar değişikliği yoktu, ama 2 hakkına sahip Pods.debug veya Pods.release ayarlayın. Taban yapılandırmasız olanı, WatchKit App'dur.

Benim orijinal 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]:xmartlabs/XLForm.git' 
pod 'Classy', git: '[email protected]: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 

Benim Podfile

benim WatchKit projesinden belirli bölmeleri hariç tutmak istediğiniz yerdir edilir değişmiş. CocoaPods tarafından çıkış

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]:xmartlabs/XLForm.git' 
    pod 'UAProgressView' 
    pod 'Classy', git: '[email protected]: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 

cevap

13

uyarılar hedefler (desteklenmez) uygulamanızda tek bir hedefe bağlanacak çalışıyoruz nedeniyle iki CocoaPods olduğunu.

yani, sen link_with "HomeHandler", "HomeHandler WatchKit Extension" ile çok HomeHandler için isimsiz hedef bağlantı veriyor, kesin bir hedef HomeHandlervar ve.

Benim önerim aşağıdaki gibi görünür şekilde Podfile yenilemek için olacaktır: ben bu hatayı alıyorum

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' 
end 

target 'HomeHandler' do 
    shared_pods 
    pod 'XLForm', git: '[email protected]:xmartlabs/XLForm.git' 
    pod 'UAProgressView' 
    pod 'Classy', git: '[email protected]: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 

target 'HomeHandler WatchKit Extension' do 
    shared_pods 
end 
+0

: kütüphane -lPods-Project_name WatchKit Uzatılması bulunamadı. MY pod dosyası: # Proje # platformunuz için küresel bir platform tanımlamak için bu satırı kaldırın # ios: '8.0' # Swift # use_frameworks kullanıyorsanız bu satırı kaldırın! platform: ios,: deployment_target => “7.0” hedef 'Project_name',: exclusive => true pod 'Google/Analytics' hedef hedefi 'Project_name WatchKit Uzantısı' pod yapın 'Google/Analytics' hedef hedefi 'Project_name WatchKit Uygulaması' pod 'Google/Analytics' sonu kylef –

+0

bu benim için xcode 8 altında çalışmıyor. Sorun olmadan iyi kurar ama projeyi derlediğimde, kapsama alanıyla ilgili olmayan binlerce uygulama hatası vardır. uzantının 'target do end 'bloğunda yer alır. – SpaceDog

İlgili konular