Cocoapods: Duplicated UUIDs in Xcode

Created on 2 Jul 2015  路  12Comments  路  Source: CocoaPods/CocoaPods

This is using:

gem 'cocoapods', :git => "[email protected]:CocoaPods/CocoaPods.git"
gem 'xcodeproj', :git => "[email protected]:CocoaPods/xcodeproj.git"

Command

/Users/orta/.rvm/gems/ruby-2.1.3/bin/pod install

Stack

   CocoaPods : 0.38.0.beta.1
        Ruby : ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]
    RubyGems : 2.2.2
        Host : Mac OS X 10.11 (15A204h)
       Xcode : 7.0 (7A121l)
         Git : git version 2.3.2.209.gd67f9d5
Ruby lib dir : /Users/orta/.rvm/rubies/ruby-2.1.3/lib
Repositories : artsy - https://github.com/artsy/Specs.git @ 7088b1620961dba6c54d38a6b2bcbb1075ed6c8f
               master - https://github.com/CocoaPods/Specs.git @ 99beb31200e0bd5be5b5b233921e945f96bbd2a6

Plugins

cocoapods-keys    : 1.2.0
cocoapods-plugins : 0.4.2
cocoapods-stats   : 0.5.3
cocoapods-trunk   : 0.6.1
cocoapods-try     : 0.4.5

Podfile

https://github.com/artsy/eidolon/blob/master/Podfile

Error

RuntimeError - [Xcodeproj] Generated duplicate UUIDs:

PBXBuildFile -- /targets/buildConfigurationList:buildConfigurations:baseConfigurationReference:displayName:Pods-KioskTests.debug.xcconfig,includeInIndex:1,isa:PBXFileReference,lastKnownFileType:text.xcconfig,path:Pods-KioskTests.debug.xcconfig,sourceTree:<group>,,buildSettings:CODE_SIGN_IDENTITY[sdk=iphoneos*]:iPhone Developer,CURRENT_PROJECT_VERSION:1,DEFINES_MODULE:YES,DYLIB_COMPATIBILITY_VERSION:1,DYLIB_CURRENT_VERSION:1,DYLIB_INSTALL_NAME_BASE:@rpath,ENABLE_STRICT_OBJC_MSGSEND:YES,INFOPLIST_FILE:Target Support Files/Pods-KioskTests/Info.plist,INSTALL_PATH:$(LOCAL_LIBRARY_DIR)/Frameworks,IPHONEOS_DEPLOYMENT_TARGET:8.0,LD_RUNPATH_SEARCH_PATHS:$(inherited),@executable_path/Frameworks,@loader_path/Frameworks,MODULEMAP_FILE:Target Support Files/Pods-KioskTests/Pods-Kiosk [...] 

^ This goes on for over 10,000 LOC

awaiting input

Most helpful comment

add 'install! 'cocoapods', :deterministic_uuids => false, :integrate_targets => false' to the root of the pod file, then do pod update. This worked for me.

All 12 comments

This is still happening to us:

Command

/Users/stepanhruda/.rvm/gems/ruby-2.1.2/bin/pod install

Stack

   CocoaPods : 0.38.0.beta.2
        Ruby : ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
    RubyGems : 2.4.6
        Host : Mac OS X 10.11 (15A216g)
       Xcode : 6.1.1 (6A2008a)
         Git : git version 2.2.2
Ruby lib dir : /Users/stepanhruda/.rvm/rubies/ruby-2.1.2/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ f4397c92c440d129cdb3e9f5bcdb06ff12d6f773

Plugins

cocoapods-plugins : 0.4.2
cocoapods-stats   : 0.5.3
cocoapods-trunk   : 0.6.1
cocoapods-try     : 0.4.5

Podfile

platform :ios, '8.0'

inhibit_all_warnings!
use_frameworks!

# I can share the rest privately if it's relevant

Error

RuntimeError - [Xcodeproj] Generated duplicate UUIDs:

# Tons of content from the .pbxproj file

Please open a new issue with the contents of a Podfile that I can use to reproduce this.

Will do, sorry.

@stepanhruda did you create an issue? I'm seeing the same, but on a podfile I can't upload so hoping not to have to reduce the bug if you have created a ticket already.

FWIW v0.37 doesn't have this issue.

We're also having the same issue and decided to go back to v0.37 as well. We'd like to have a reference to the new issue created by @stepanhruda though :)

There's no need to downgrade because of this, one can simply opt-out of deterministic UUIDs for now, see https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md#enhancements-1

In case you can share anything to reproduce the issue, that'd be greatly appreciated :)

thanks we'll try that ! Well maybe we can show you stuff one on one but I can't post our podfile online ;)

I am getting this issue with the following Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

use_frameworks!

target :'ZeeMeeApp' do
  pod 'AFNetworking', '= 2.6.0'
  pod 'Alamofire', '~> 3.0.1'
  pod 'FPPicker', '~> 5.0.1'
  pod 'SwiftyJSON', '~> 2.3.0'
  pod 'SVWebViewController'
  pod 'Kingfisher', '1.6.1'
  pod 'FSImageViewer'
  pod 'SwiftValidator', '3.0.0'
  pod 'Kanna', '~> 1.0.0'

  pod 'Fabric'
  pod 'PSPDFTextView'

  # Depending on how your project is organized, your node_modules directory may be
  # somewhere else; tell CocoaPods where you've installed react-native from npm
  pod 'React', :path => './node_modules/react-native',
    :subspecs => [
      'Core',
      'RCTActionSheet',
      'RCTAdSupport',
      'RCTGeolocation',
      'RCTImage',
      'RCTNetwork',
      'RCTPushNotification',
      'RCTSettings',
      'RCTText',
      'RCTVibration',
      'RCTWebSocket',
      'RCTLinkingIOS'
    ]

end

post_install do |installer|
   puts installer.pods_project
   puts installer.pods_project.targets

   installer.pods_project.targets.each do |target|
       puts "  " + target.inspect 
       puts target.name
       if target.name = "React"
         target.build_configurations.each do |config|
           if config.name = "DebugStaging"
              config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['DEBUG=1']
           end
           if config.name = "DebugProduction"
              config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['DEBUG=1']
           end
         end
       end
   end
 end

Did you ever get a resolution to the error in that podfile @DougBanksPersonal ?

add 'install! 'cocoapods', :deterministic_uuids => false, :integrate_targets => false' to the root of the pod file, then do pod update. This worked for me.

It's caused by duplicate files in different directories.
Sometimes Xcode might make mistake and duplicate files when you move files to another directory.

My solution to find these duplicate files,

  1. copy error messages to a text file named such as duplicateUUIDs.txt
  2. get sorted file names and output duplicated items
    grep -E '[a-zA-Z+]+\.(h|m|swift)' -o duplicateUUIDs.txt | sort | uniq -d
  3. find them in your pod source directory and delete unnecessary files.

Another method to find duplicate files
find . -path ./.git -prune -o -type f -exec basename {} + | sort | uniq -d
where -path ./.git -prune -o means to exclude .git directory when finding

Was this page helpful?
0 / 5 - 0 ratings