Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple Groups and duplicate UUID with watchOS 2 project #4326

Closed
seboslaw opened this issue Oct 6, 2015 · 25 comments
Closed

multiple Groups and duplicate UUID with watchOS 2 project #4326

seboslaw opened this issue Oct 6, 2015 · 25 comments
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor

Comments

@seboslaw
Copy link

seboslaw commented Oct 6, 2015

Hey guys,

I tried setting up a brand new watchOS 2 project (incl. parent iOS app), but ran into some trouble with Cocoapods (0.39.rc.1).

Consider the following Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '8.4'
# Uncomment this line if you're using Swift
use_frameworks!


target 'cocoapodsTest' do
  pod 'ReactiveCocoa', '2.4.7'
  pod 'PSUpdateApp'
  pod 'Alamofire'
end

target 'cocoapodsTestUITests' do

end

target 'cocoapodsTest WatchKit App' do

end

target 'cocoapodsTest WatchKit Extension' do
    platform :watchos, '2.0'
    pod 'Alamofire'
end

Running pod install I get the following:

Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.6.0)
Installing Alamofire (2.0.2)
Installing PSUpdateApp (2.0.5)
Installing ReactiveCocoa (2.4.7)
Generating Pods project
2015-10-06 13:07:13.175 ruby[54907:498303] warning:  The file reference for "Alamofire.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

[!] Please close any current Xcode sessions and use `cocoapodsTest.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 4 total pods installed.

[!] [Xcodeproj] Generated duplicate UUIDs:

PBXFileReference -- /mainGroup/children/children:displayName:AFNetworking.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:AFNetworking.framework,path:AFNetworking.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Alamofire.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Alamofire.framework,path:Alamofire.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Alamofire.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Alamofire.framework,path:Alamofire.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_cocoapodsTest.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_cocoapodsTest.framework,path:Pods_cocoapodsTest.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_cocoapodsTest_WatchKit_Extension.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_cocoapodsTest_WatchKit_Extension.framework,path:Pods_cocoapodsTest_WatchKit_Extension.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:PSUpdateApp.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:PSUpdateApp.framework,path:PSUpdateApp.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:ReactiveCocoa.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:ReactiveCocoa.framework,path:ReactiveCocoa.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Products,isa:PBXGroup,name:Products,sourceTree:<group>,/Products/children/displayName:Alamofire.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Alamofire.framework,path:Alamofire.framework,sourceTree:BUILT_PRODUCTS_DIR,/Products/Alamofire.framework

What's the way to make this work?

@seboslaw seboslaw changed the title multiple Groups and duplicate UUID multiple Groups and duplicate UUID with watchOS 2 project Oct 6, 2015
@segiddins
Copy link
Member

Those should all only be warnings, so everything should still be working

@seboslaw
Copy link
Author

seboslaw commented Oct 6, 2015

Hm, upon archiving I get the following message within XCode:

/Users/me/test/cocoapodsTest/Pods/<module-includes>:1:1: Umbrella header for module 'Alamofire' does not include header 'Pods-cocoapodsTest WatchKit Extension-Alamofire-umbrella.h'

Within in the console I see:

06.10.15 16:45:58,145 Xcode[1499]: Cannot make directory /Users/me/Library/Developer/Xcode/Archives/2015-10-06/cocoapodsTest 06.10.15, 16.45.xcarchive/dSYMs/Alamofire.framework.dSYM: File exists

Archiving fails (in that it won't open the Organizer after finishing the build).

@neonichu
Copy link
Member

neonichu commented Oct 7, 2015

have you turned off target deduplication by any chance?

@neonichu neonichu added the s1:awaiting input Waiting for input from the original author label Oct 7, 2015
@seboslaw
Copy link
Author

seboslaw commented Oct 7, 2015

Hey @neonichu, I just tried rebuilding with your sample project (native-watchOS-example). With target reduplication turned off I get the same error as mentioned above when running pod install.
When trying to archive, instead of building and not opening the Organizer, I now get errors like:

ld: building for watchOS, but linking against dylib built for iOS, file '/Users/svogelsang/Library/Developer/Xcode/DerivedData/watchOSsample-edkvasdtczykwgftgcjlvvkynfvt/Build/Intermediates/ArchiveIntermediates/watchOSsample/BuildProductsPath/Release-watchos/Pods-watchOSsample WatchKit Extension/Alamofire.framework/Alamofire' for architecture armv7k
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@neonichu
Copy link
Member

neonichu commented Oct 7, 2015

@seboslaw yep, I was asking because it needs to be turned on (default) to work properly with extensions.

@seboslaw
Copy link
Author

seboslaw commented Oct 7, 2015

ah, ok. Well with it turned on I get the results described at the top of this thread ;) Can you reproduce it with your own sample watch project?

@Arclite
Copy link

Arclite commented Oct 8, 2015

I'm seeing similar results on 0.39.rc.1. Both warnings go away if I disable deterministic UUIDs (COCOAPODS_DISABLE_DETERMINISTIC_UUIDS). I can attach my Podfile/podspec (I'm using a locally-installed pod) if it helps.

@segiddins
Copy link
Member

Yeah, to debug duplicate UUID bugs a sample project is necessary, but unfortunately those are kind of at the bottom of my todo list at the moment.

@neonichu
Copy link
Member

neonichu commented Oct 8, 2015

@seboslaw not really, the watch sample project works just fine for me

@seboslaw
Copy link
Author

seboslaw commented Oct 8, 2015

@neonichu hm....so without any modifications you don't get the warnings above when doing pod install and you're able to archive without any problems?
BTW: by disabling deterministic UUIDs I can also make those warnings go away, but the archiving still fails with this error:

ld: building for watchOS, but linking against dylib built for iOS, file '/Users/svogelsang/Library/Developer/Xcode/DerivedData/watchOSsample-edkvasdtczykwgftgcjlvvkynfvt/Build/Intermediates/ArchiveIntermediates/watchOSsample/BuildProductsPath/Release-watchos/Pods-watchOSsample WatchKit Extension/Alamofire.framework/Alamofire' for architecture armv7k
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@danielerne
Copy link

We are currently experience the same issue and can't archive the project now.. We have a project with an extension and a watchos 2 app. ...dSym: File exists..

@danielerne
Copy link

After hours of trial and error... The problem occurs when adding a Watch Extension Target in the podfile. It doesn't work anymore. If we remove the extension target everything works fine.. But we need some pods in the extension..

This works:
target 'Landi-Watch Extension' do
platform :watchos, '2.0'
end

This not:
target 'Landi-Watch Extension' do
platform :watchos, '2.0'
pod 'Alamofire', '~> 2.0'
end

@iGranDav
Copy link

Hey guys,

Managed to reproduce it with tvOS. Added a demo project to help.
https://github.com/iGranDav/CocoaPods_Issue-4326

Please re-open this issue

@AliSoftware AliSoftware reopened this Oct 16, 2015
@AliSoftware AliSoftware added s2:confirmed Issues that have been confirmed by a CocoaPods contributor and removed s1:awaiting input Waiting for input from the original author labels Oct 16, 2015
@Spacelapp
Copy link

Same problem......

@buithuyen
Copy link

Same for me

use_frameworks!

def shared_pods
pod 'AFNetworking'
end

target 'WatchPod' do
platform :ios, '9.0'
shared_pods
end

target 'WatchApp Extension' do
platform :watchos, '2.0'
shared_pods
end
CocoaPods 1.0.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
2016-01-11 16:03:08.452 ruby[23276:1660954] warning:  The file reference for "AFNetworking.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.
Removing Mantle
Downloading dependencies
Using AFNetworking (3.0.4)
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] [Xcodeproj] Generated duplicate UUIDs:

PBXFileReference -- /mainGroup/children/children:displayName:AFNetworking.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:AFNetworking.framework,path:AFNetworking.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:AFNetworking.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:AFNetworking.framework,path:AFNetworking.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_WatchApp_Extension.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_WatchApp_Extension.framework,path:Pods_WatchApp_Extension.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Pods_WatchPod.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:Pods_WatchPod.framework,path:Pods_WatchPod.framework,sourceTree:BUILT_PRODUCTS_DIR,,displayName:Products,isa:PBXGroup,name:Products,sourceTree:<group>,/Products/children/displayName:AFNetworking.framework,explicitFileType:wrapper.framework,includeInIndex:0,isa:PBXFileReference,name:AFNetworking.framework,path:AFNetworking.framework,sourceTree:BUILT_PRODUCTS_DIR,/Products/AFNetworking.framework

@manuelmarcos
Copy link

👍 Same problem here as @buithuyen

@segiddins
Copy link
Member

Can any of y'all see if this is fixed in the 1.0 beta? I'm fairly sure it is.

@manuelmarcos
Copy link

I am sorry @segiddins but I actually just tried in a brand new project using pod version 0.39.0 and it all worked fine.
The pod file looks like this:

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

def shared_pods
    pod 'Alamofire', '~> 3.0'
end

target 'iosTarget' do
    platform :ios, '9.0'
    use_frameworks!
    shared_pods
end

target 'tvosTarget' do
    platform :tvos, '9.0'
    use_frameworks!
    shared_pods
end

I believe this solution should also be valid for @buithuyen , @Spacelapp and @iGranDav ...

Cheers.

@buithuyen
Copy link

@manuelmarcos 👍 It works for me as below:

target 'AppDemo' do
pod 'Realm','0.94.1'
pod 'AFNetworking','2.6.3'
pod 'SDWebImage'
end

target 'Watch Extension' do
use_frameworks!
platform :watchos, '2.0'
pod 'Realm','0.94.1'
pod 'AFNetworking','2.6.3'
end

@manuelmarcos
Copy link

Glad to hear it is working for you @buithuyen
Perhaps we can close this issue? @AliSoftware ?
Thanks guys!

@iGranDav
Copy link

This works perfectly for me also guys thanks! 👍

keitaito added a commit to keitaito/MenMa that referenced this issue Feb 2, 2016
- Venue class is used in InterfaceController in WatchKit Extension.
- Alamofire’s protocol URLStringConvertible is used in Venue.
- Venue needs to be selected for iOS App and WatchKit Extension for
Target Membership.
- Alamofire needs to be added into WatchKit Extension Target as well as
iOS App Target.

To solve the above issues, Alamofire pod needs to be added in both iOS
App and WatchKit Extension in Podfile.

Reference:
CocoaPods/CocoaPods#4326
https://medium.com/@mosn/watchos-2-0-pod-install-5236a40ca4bc#.pxbbegwye
@cobear25
Copy link

I have the same problem but I don't see what's wrong with my podfile:

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

def common_pods
  pod 'Alamofire', '~> 3.0'
  pod 'Raven', :git => 'https://github.com/getsentry/raven-objc.git', :tag => '1.0.1'
  pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
  pod 'SDWebImage', '~> 3.7.5'
  pod 'JSQCoreDataKit'
  pod 'MBProgressHUD', :git => 'https://github.com/smejkpa7/MBProgressHUD.git'
end

target 'Proj' do
  use_frameworks!
  platform :ios, '8.0'
  common_pods
end

target 'ProjTvOS' do
  use_frameworks!
  platform :tvos, '9.0'
  common_pods
end

@manuelmarcos
Copy link

Hey! Lets see if we can fix this. Few questions @cobear25

1.- Are you sure that all common pods support both platforms?
2.- Are you sure your targets names are exactly the same as define in Xcode?
3.- Are you running the latest version of cocoapods?
4.- Could you paste some more info? (Stack trace error)

Cheers

@FelixLisczyk
Copy link

I'm having the same problem with CocoaPods 0.39.0, which leads to a linker error upon archiving the app (build runs fine). Here's my podfile:

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

target 'App' do
    platform :ios, '8.2'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'RealmSwift'
end

target 'Watch Extension' do
    platform :watchos, '2.0'
    pod 'RealmSwift'
end

Adding "RealmSwift" to my watch extension causes my today and share extensions to fail linking:

ld: framework not found Realm for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Upgrading to CocoaPods 1.0.0 beta3 resolves the error messages in CocoaPods, but this version is unfortunately not yet compatible with Realm, see realm/realm-swift#3052

Update: I've started using Realm in my watch extension and now receive the same linking error there upon building and archiving. I've managed to get the build working by adding "$BUILT_PRODUCTS_DIR" to my framework search paths (Realm.framework is located there), but archiving still fails and I also run into a runtime error upon launch (library not loaded). I think CocoaPods tries to link the iOS version of Realm with my watch extension instead of the watchOS version.

@JanGorman
Copy link

Same issue here and CocoaPods beta doesn't fix this either. It starts popping up as soon as I add use_frameworks! to one of the targets. I cannot set all targets to use_frameworks! because the iOS target has transitive dependencies that include static binaries.

Consider the following simplified example:

platform :ios, '8.0'

def common_pods
  pod 'AFNetworking'
end

target 'iOS' do
  common_pods
  
end

target 'tvOS' do
  platform :tvos, '9.0'
  use_frameworks! #as soon as I add this here, I get the warning about multiple groups. Without this, it works fine
  common_pods
  
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Projects
None yet
Development

No branches or pull requests