6

After I added new dependency to my project and run pod install, I have duplicate target in my workspace(.xcworkspace) as below:

enter image description here

And this is the pod file structure:

platform :ios, '8.0'
use_frameworks!
pod 'AFNetworking', '~> 2.6'
pod 'Fabric'
pod 'Crashlytics'
pod 'SocketRocket'

I restart the project and also Xcode, but it does not help. What is the reason and how can I solve the problem?

5
  • Can you show your podfile structure? Commented Oct 10, 2016 at 15:19
  • Have you tried removing and re-running pod install ? Did it have the same effect ?
    – userx
    Commented Oct 10, 2016 at 15:20
  • Delete your .xcworkspace, podfile.lock and pods folder and try again pod install.
    – SukruK
    Commented Oct 10, 2016 at 15:41
  • @alex I add it to question Commented Oct 10, 2016 at 17:23
  • @userx I want to find the reason too, because many of my project have the same problem in XCode 8 Commented Oct 10, 2016 at 17:25

1 Answer 1

11

First, try to wrap your pods with target specification, like this:

target 'TargetName' do
  pod 'Fabric'
  pod 'Crashlytics' 
  #other pods 
end
  1. Delete your .xcworkspace, podfile.lock and pods folder, just as @SukruK suggested.
  2. Do pod install again and open the workspace created.

You can do the following instructions in order to fix this configuration issue CocoaPods did not set the base configuration of your project because your project already has a custom config set.

  1. Go to your project settings
  2. Set None configuration set for both Pods-related targets
  3. Run pod install again

enter image description here

3
  • It does not help with error: [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target XXX to Pods/Target Support Files/Pods-XXX/Pods-mothera_socket.debug.xcconfig or include the Pods/Target Support Files/Pods-XXX_socket/Pods-XXX.debug.xcconfig in your build configuration. Commented Oct 15, 2016 at 7:17
  • @SoheilNovinfard See the updated unswer, it should help. Commented Oct 15, 2016 at 10:36
  • I am also facing almost same issue. Instead of duplicating the folder, its duplicating the files in my case. I cannot delete the pod.lock because when I run the pod install , it will install the latest version of existing library. Since I use the different version of Alamofire, it will cause other error. How will I solve it ?
    – RP89
    Commented Sep 22, 2022 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.