Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods adds duplicate project to xcworkspace

My workspace structure is the following:
-ProjectA
--ProjectB
--ProjectC
-Pods

I run the 'pod update' and what I get is
-ProjectA
--ProjectB
--ProjectC
-Pods
-ProjectB <- this should not be here!

My Podfile is:

platform :ios, '7.0'
inhibit_all_warnings!
workspace 'ProjectA'

target :ProjectA do
    pod "AFNetworking", "~> 2.0"
    pod 'Facebook-iOS-SDK'
    pod 'SDWebImage'
    pod 'FXBlurView'
    pod 'RESideMenu'
    pod 'RBStoryboardLink'
end

target :ProjectBTests do
    xcodeproj 'Libraries/ProjectB/ProjectB'
    pod 'Expecta'
    pod 'Specta'
    pod 'OCMock'
end

So is it possible to do anything with such behaviour?

Thanks!

like image 392
StalkerRus Avatar asked Aug 19 '14 15:08

StalkerRus


People also ask

Do I open XcodeProj or Xcworkspace?

You should see them side by side in your project folder. The xcworkspace is created by cocoapods and needs to be opened instead of the xcodeproj. So that xcode resolves dependencies properly.

Should Podfile lock be checked in?

As a reminder, even if your policy is not to commit the Pods folder into your shared repository, you should always commit & push your Podfile. lock file. Otherwise, it would break the whole logic explained above about pod install being able to lock the installed versions of your pods.

What is Podfile lock?

Podfile. lock is used to make sure that every members of the team has the same versions of pods installed on the project. This file is generated after you run the command: pod install. It gets updated when you run pod install or pod update.

How do I add dependencies to Podfile?

When you add a new dependency and re-import the project in IntelliJ IDEA, the new dependency will be added automatically. No additional steps are required. To use your Kotlin project with Xcode, you should make changes in your project Podfile. A Kotlin project requires the pod() function call in build.


1 Answers

Please register it as a bug in coocoapods. The generated xcworkspace file is incorrect.

<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "group:ProjectA.xcodeproj">
   </FileRef>
   <FileRef
      location = "group:Pods/Pods.xcodeproj">
   </FileRef>
   <FileRef
      location = "group:ProjectA/ProjectB/ProjectB.xcodeproj">
   </FileRef>
</Workspace>
like image 124
bllakjakk Avatar answered Oct 21 '22 10:10

bllakjakk