我有一个带有共享扩展名的应用。我的应用程序取决于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]警告:“ CocoaLumberjack.framework”的文件引用是多个组(“产品”和“产品”)的成员;这表示项目格式错误。仅保留其中一个组的成员身份(但目标的成员身份不受影响)。如果要在多个组中引用同一文件,请在同一路径中添加另一个引用。
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: .framework,explicitFileType:包装器框架,包括InIndex:0,isa:PBXFileReference,名称:CocoaLumberjack.framework,路径:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR,displayName:Pods_MyProject.framework,explicitFileType:wrapper.framework,includeInIndex:0, isa:PBXFileReference,名称:Pods_MyProject.framework,路径:Pods_MyProject.framework,sourceTree:BUILT_PRODUCTS_DIR,显示名称:Pods_MyShare.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,名称:Pods_MyShare_frameShare,路径:Pods .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。框架,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第4370期有关。我将示例项目发布在github上。
这是Cocoapods中的错误-可能不会在很长一段时间内修复-
目前export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
在终端机上运行似乎可以消除警告。
编辑2016年2月:
在最新版本的Cocoapods中,现在已将其移至Podfile的install部分: install! 'cocoapods', :deterministic_uuids => false
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句