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?

Soheil Novinfard
  • 1,358
  • 1
  • 16
  • 43

1 Answers1

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

alexburtnik
  • 7,661
  • 4
  • 32
  • 70
  • 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. – Soheil Novinfard Oct 15 '16 at 07:17
  • @SoheilNovinfard See the updated unswer, it should help. – alexburtnik Oct 15 '16 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 Sep 22 '22 at 13:29