2015-10-28 31 views
17

Ho un'app con un'estensione di condivisione. La mia app dipende da CocoaLumberjack/Default e la mia estensione di condivisione dipende da CocoaLumberjack/Core. Quando costruisco con use_frameworks!, ottengo il seguente errore:Il riferimento al file CocoaPods è un membro di più gruppi

$ rm -rf Pods Podfile.lock; pod install 
Updating local specs repositories 
Analyzing dependencies 
Downloading dependencies 
Installing CocoaLumberjack (2.0.3) 
Generating Pods project 

2015-10-28 10:46:04.015 ruby[53095:3440989] warning: The file reference for "CocoaLumberjack.framework" is a member of multiple groups ("Products" and "Products"); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.

Integrating client project 
Sending stats 
Sending stats 
Pod installation complete! There are 2 dependencies from the Podfile and 1 total 
pod installed. 

[!] [Xcodeproj] Generated duplicate UUIDs: 

PBXFileReference -- /mainGroup/children/children:displayName:CocoaLumberjack.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:CocoaLumberjack.framework,path:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:CocoaLumberjack.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:CocoaLumberjack.framework,path:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_MyProject.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_MyProject.framework,path:Pods_MyProject.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_MyShare.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_MyShare.framework,path:Pods_MyShare.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Products,isa:PBXGroup,name:Products,sourceTree:,/Products/children/displayName:CocoaLumberjack.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:CocoaLumberjack.framework,path:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR,/Products/CocoaLumberjack.framework

Questo è il mio Podfile:

workspace 'MyWorkspace' 
xcodeproj 'MyProject/MyProject.xcodeproj' 

use_frameworks! 

source 'https://github.com/CocoaPods/Specs.git' 

link_with 'MyProject', 'MyShare' 

target :MyProject do 
    pod 'CocoaLumberjack', '~> 2.0.1' 
end 

target :MyShare do 
    pod 'CocoaLumberjack/Core', '~> 2.0.1' 
end 

ero in grado di ovviare a questo problema rendendo entrambi i miei obiettivi usano lo stesso sottospec CocoaLumberjack. Il mio lavoro è al di sotto Podfile:

workspace 'MyWorkspace' 
xcodeproj 'MyProject/MyProject.xcodeproj' 

use_frameworks! 

source 'https://github.com/CocoaPods/Specs.git' 

link_with 'MyProject', 'MyShare' 

target :MyProject do 
    pod 'CocoaLumberjack/Core', '~> 2.0.1' 
end 

target :MyShare do 
    pod 'CocoaLumberjack/Core', '~> 2.0.1' 
end 

Perché questa soluzione necessaria? Cosa succede quando ho effettivamente dipendenze subspec differenti tra due target?

EDIT

questo sembra correlata alla CocoaPods Issue 4370. Ho pubblicato il mio progetto di esempio su github.

+1

Lo stesso problema qui, svalutato! A proposito, hai provato ad archiviare il prodotto nonostante gli errori? Ti sta dando degli errori relativi alle intestazioni degli ombrelli? Cocoapods + use_frameworks! + xcode 7.1 totalmente incasinato il mio ambiente :( – ale0xB

+0

@ ale0xB Qualsiasi soluzione al tuo problema usando Xcode 7.1? –

+0

Xcode 7.1 non ha aiutato. –

risposta

17

Si tratta di un bug nel Cocoapods -E probabilmente non verrà risolto in un lungo while-

esecuzione export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES sul Terminal sembra sopprimere le avvertenze per ora.

EDIT Feb 2016:

Nella versione più recente di Cocoapods questo è stato ora spostato alla sezione installazione del Podfile: install! 'cocoapods', :deterministic_uuids => false

+0

Dicono che è stato corretto in '1.0.0.beta.4' https: // github.com/CocoaPods/CocoaPods/issues/4370#issuecomment-188392490 –

0

ho incontrato questo errore quando si aggiunge un'estensione dell'applicazione.

L'ho risolto ripetendo la riga platform :ios, '7.0' presente nella destinazione dell'applicazione sul mio nuovo target.

Assicurarsi che i due obiettivi utilizzino la stessa piattaforma per risolvere il problema.