2015-10-28 1 views
17

У меня есть приложение с расширением для общего доступа. Мое приложение зависит от CocoaLumberjack/Default, а мое расширение зависит от CocoaLumberjack/Core. Когда я строю с use_frameworks!, я получаю следующее сообщение об ошибке:Ссылка на файл CocoaPods является членом нескольких групп

$ 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

Это мой 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 

я смог обойти эту проблему, сделав обе мои цели используют один и тот же набор CocoaLumberjack. Мой рабочий 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 

Почему это временное решение необходимо? Что происходит, когда у меня на самом деле есть разные зависимости между объектами между двумя целями?

EDIT

Это выглядит связано с CocoaPods Issue 4370. Я разместил свой пример проекта на github.

+1

Тот же вопрос здесь, upvoted! Кстати, вы пытались архивировать продукт, несмотря на ошибки? Это дает вам ошибки, связанные с заголовками зонтика? Cocoapods + use_frameworks! + xcode 7.1 полностью перепутал мой env :( – ale0xB

+0

@ ale0xB Любое решение вашей проблемы с помощью Xcode 7.1? –

+0

Xcode 7.1 не помогло. –

ответ

17

Это ошибка в Cocoapods -И, вероятно, это не будет исправлено в длинном while-

Запуск export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES на терминале, кажется подавить предупреждения сейчас.

EDIT Февраль 2016:

В последней версии Cocoapods теперь это был перемещен в раздел установки на Podfile: install! 'cocoapods', :deterministic_uuids => false

+0

Они утверждают, что это было исправлено в '1.0.0.beta.4' https: // github.com/CocoaPods/CocoaPods/issues/4370#issuecomment-188392490 –

0

я столкнулся с этой ошибкой при добавлении расширения приложения.

Я исправил его, повторив строку platform :ios, '7.0', присутствующую в моей целевой программе, и на мою новую цель.

Убедившись, что две цели используют одну и ту же платформу, решили проблему для меня.

Смежные вопросы