0

I had cocoapods in my project and it worked fine. But now that I upgraded my xCode and everything else, I get a linker error about the pods when I try to archive the project.

I was trying to follow the solutions in this answer but the steps they mention are not quite what I see on my screen.

What are the steps to configure my cocoapods correctly?

Here is a screenshot of how things are appearing for me with the libraries in red on the left side, and some configurations on the main area of the screen.

enter image description here

Community
  • 1
  • 1
Genadinik
  • 18,153
  • 63
  • 185
  • 284
  • You should follow instructions in that answer. Close Xcode, open Terminal, go to your project folder where Podfile resides, run suggested commands. – mostruash Dec 17 '13 at 16:36
  • @mostruash what will happen to the things that are currently in the pods? Also, this is a bit silly, but I am not sure how to find my current version of cocoapods. Would you know how to do that? – Genadinik Dec 17 '13 at 16:41
  • 1
    Have you put stuff into your Pods project? Because it is supposed to be auto-generated by CocoaPods tool and it should not be modified. When you do `pod install`, Pods project will be regenerated and it will probably fix the project configuration related to iOS 7. You can check the version using `pod --version`. And yes, it will put your dependencies into the new Pods project (e.g. AFNetworking). – mostruash Dec 17 '13 at 16:43
  • @postruash well, the whole pods thing was made by another developer who is not in the project anymore. So I am just learning about pods now. I guess what you are saying (and the other person answering my question is saying) that if I back up, and put back the configs file, everything should be ok? – Genadinik Dec 17 '13 at 16:46
  • You don't need to back up at all, but to feel safe, copy your whole project folder to another place, and run `pod install` in your original project's folder. Please consider checking cocoapods.org – mostruash Dec 17 '13 at 16:49
  • @mostruash yes that is a good practice to backup the whole thing just incase. But all you need is your is your pod file. This holds all the information to re-download when you run pod install. – mikemike396 Dec 17 '13 at 16:51

1 Answers1

2

Make a backup of your .pod config file that has all your third party project references in it. Delete pods folder and delete workspace that Cocopods creates by default.

This is the file to backup

enter image description here

$ sudo gem install cocoapods

Navigate to where project lives:

 cd /Users/yourUserFolder/LocationOfProject/

Then Run:

$ pod install

Open Workspace

$ open App.xcworkspace

**Make sure you open the workspace file. Not the .project file.

Image of what my .pod file looks like, just for your reference to make sure you have the correct format. enter image description here

mikemike396
  • 2,435
  • 1
  • 26
  • 41
  • can you install iOS stuff with gem commands? I thought it was only a ruby thing? Plus I am not sure how to reinstall everything correctly from scratch. How do I move the things currently in my pods to my main project? – Genadinik Dec 17 '13 at 16:38
  • thanks - but what should happen to all the things that are currently in the pods? If I put the pods config file back, will it know to put everything else back into the pods? – Genadinik Dec 17 '13 at 16:43
  • Yes as long as you didn't modify any of the projects that were downloaded from cocopods, once you run $pod install. It will re-pull-down all the projects that are referenced in the podfile – mikemike396 Dec 17 '13 at 16:45
  • 1
    Ok trying now...will report results in a few minutes :) thanks! – Genadinik Dec 17 '13 at 16:48
  • Actually, I do not seem to have a .pod file that you mentioned. Take a look at the screenshot that I originally posted. It doesn't have a .pod file in there. Would you know where that file is? – Genadinik Dec 17 '13 at 16:53
  • It looks like the only project you are using is AFNetwork. I would just delete all the cocopods stuff and start from scratch. Then put "pod "AFNetworking", "~> 2.0"" in your podfile that will be created. – mikemike396 Dec 17 '13 at 16:53
  • Yes, it will get recreated when you start over and run $ pod install in the directory of your project folder. – mikemike396 Dec 17 '13 at 16:57
  • 1
    Sorry for the delay. I am trying to see whether things would be ok with just having pods removed. But I am getting some errors and working through them. – Genadinik Dec 17 '13 at 17:41
  • No problem. Let me know if you have any more questions. Also accept this answer if it helped you out. Thanks. – mikemike396 Dec 17 '13 at 19:14