2015-03-28 9 views
8

Dodałem rozszerzenie WatchKit do mojego obecnego projektu. Projekt używa Cocoapods 0.36.1 do dodania niektórych frameworków, ale teraz chcę wykluczyć niektóre strąki z projektu rozszerzenia WatchKit.Uwzględnij strąki w głównym celu, a nie w rozszerzeniu WatchKit.

Projekt rozszerzenia WatchKit nie wymaga wielu frameworków, których używam w moim normalnym celu, ale nie mogę sprawić, aby Cocoapods działały poprawnie po zmianie mojego Podfile.

używam use_frameworks! w moim Podfile, ale po uruchomieniu pod install uzyskać następujące komunikaty:

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

nie zmieniać żadnych ustawień dla moich konfiguracjach bazowych, ale 2 z moich 3 celów mają prawo Pods.debug lub Pods.release zestaw. Ten bez konfiguracji podstawowej to WatchKit App.

Mój oryginalny 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 

My zmieniony Podfile

to gdzie chcę wyłączyć niektóre strączki z mojego projektu WatchKit.

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 

Odpowiedz

13

Ostrzeżenia wygenerowanych przez CocoaPods Wynika to z dwóch CocoaPods cele starają się być związana z jednym celu w aplikacji (który nie jest obsługiwany).

tj, trzeba się wyraźnym celem HomeHandleri łączysz bezimienny cel HomeHandler też z link_with "HomeHandler", "HomeHandler WatchKit Extension".

Moja sugestia będzie zreorganizować swój Podfile aby wyglądać tak:

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

otrzymuję ten błąd: biblioteki nie znaleziono -lPods-PROJECT_NAME WatchKit Extension. Mój plik pod jest: # Odkomentuj tę linię, aby zdefiniować globalną platformę dla platformy # projektu: ios, '8.0' # Odkomentuj tę linię, jeśli używasz Swift # use_frameworks! platforma: ios,: deployment_target => "7.0" target "Project_name",: exclusive => true do pod 'docelowy cel Google/Analytics' Project_name Rozszerzenie WatchKit 'do pod' Cel końcowy Google/Analytics 'Nazwa projektu WatchKit App' do pod 'Google/Analytics' end @kylef –

+0

to nie działa dla mnie pod xcode 8. Dobrze się instaluje bez problemu, ale kiedy kompiluję projekt, są tysiące błędów związanych z tym, że strąki są zawarte w rozszerzeniu aplikacji, nawet gdy nie są zawarte w bloku 'target do end' rozszerzenia. – SpaceDog

Powiązane problemy