CocoaPods文件引用是多个组的成员

我有一个附加扩展名的应用程序。我的应用程序依赖于CocoaLumberjack / Default,而我的共享扩展名依赖于CocoaLumberjack / Core。当我使用use_frameworks!构建时,我收到以下错误:

$ 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

为什么需要这种解决方法?当我实际上在两个目标之间有不同的subspec依赖关系时会发生什么?

编辑

这看起来与CocoaPods Issue 4370相关。我在github发布了我的示例项目。

这是Cocoapods中的一个错误 – 可能它不会在很长一段时间内被修复 –

运行出口COCOAPODS_DISABLE_DETERMINISTIC_UUIDS = YES现在似乎压制了警告。

EDIT Feb 2016:

在最新版本的Cocoapods中,现在已经转移到Podfile的安装部分:install! ‘cocoapods’,:deterministic_uuids =>假

http://stackoverflow.com/questions/33395675/cocoapods-file-reference-is-a-member-of-multiple-groups

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:CocoaPods文件引用是多个组的成员