CocoaPods文件引用是多个组的成员 [英] CocoaPods file reference is a member of multiple groups

查看:452
本文介绍了CocoaPods文件引用是多个组的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有共享扩展名的应用。我的应用程序依赖于 CocoaLumberjack /默认,我的扩展名依赖于 CocoaLumberjack / Core 。当我使用 use_frameworks!进行构建时,出现以下错误:

I have an app with a share extension. My app depends on CocoaLumberjack/Default, and my share extension depends on CocoaLumberjack/Core. When I build with use_frameworks!, I get the following error:

$ 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的参考是多个
组(产品和产品)的成员;这表明
项目格式错误。
仅保留其中一个组的成员资格(但目标的成员资格不会受到影响)。如果要在多个组中对同一文件的
引用,请在同一路径中添加另一个
引用。

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,显示名称:CocoaLumberjack.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,名称:CocoaLumberjack.framework,path:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR,displayName:Type:Pods_My wrapper.framework,includeInIndex:0,isa:PBXFileReference,名称:Pods_MyProject.framework,路径:Pods_MyProject.framework,sourceTree:BUILT_PRODUCTS_DIR,displayName:Pods_MyShare.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name :Pods_MyShare.framework,路径:Pods_MyShare.framework,sourceTree:BUILT_PRODUCTS_DIR ,, displayName:Products,isa:PBXGrou p,名称:Products,sourceTree:,/产品/儿童/显示名称:CocoaLumberjack.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,名称:CocoaLumberjack.framework,路径:CocoaLumberjack.framework,sourceTree:BUILT_PRODUCTS_DIR, /Products/CocoaLumberjack.framework

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 如下:

I was able to work around this problem by making both of my targets use the same CocoaLumberjack subspec. My working Podfile is below:

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

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

Why is this workaround necessary? What happens when I actually have different subspec dependencies between two targets?

EDIT

这与 CocoaPods第4370期有关。我将示例项目发布在 github 上。

This looks related to CocoaPods Issue 4370. I posted my example project on github.

推荐答案

这是Cocoapods中的错误-可能很长一段时间内不会修复-

This is a bug in Cocoapods -And probably it won't be fixed in a long while-

运行<$ c $终端上的c> export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS = YES 似乎现在禁止显示警告。

Running export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES on the Terminal seems to suppress the warnings for now.

编辑2016年2月:

在最新版本的Cocoapods中,该内容现已移至Podfile:安装! ‘cocoapods’,:deterministic_uuids =>错误

In latest version of Cocoapods this has now been moved to the install section of the Podfile: install! 'cocoapods', :deterministic_uuids => false

这篇关于CocoaPods文件引用是多个组的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆