Trouble after renaming Xcode project - xcode

I have followed this guide to change the name of my Xcode project. But after doing that, the .xcworkspace is empty. The .xcodeproj looks fine.
What can I have missed/forgot?

Do you use cocoapods in your project? If yes, you could simply delete your .xcworkspace file, Pod folder, Podfile.lock file and install pods again.

Related

Deleting a pod and all of its files from a project

So I'm working on a project and I had installed RealmSwift as my DB but later on I figured I can just use a plist to store my data, I went to the pod file, I erased pod 'RealmSwift' and went on terminal to uninstall my pod, everything went well. But my question is, is there a way to fully delete a pod file from a project and revert the project from an xcworkspace to an xcode project? the Pod file still shows under the name of my project, and I feel like submitting a project like that is not clean.

Opening Xcode project with two pods installed

I'm trying to add to my app both Moltin and Firebase pods. I know that if I want to open the file (with only one pod installed) I need to open it from the .xcworkspace file instead of using the .xcodeproj file.
Which file do I have to open if I have more than one pod installed (and so two .xcworkspace files)?
After you install your first pod, you should always use .xcworkspace.
It doesn't matter how many pods you have installed, after the first one, always use .xcworkspace.
In other words:
0 pods, use .xcodeproj
1+ pods, use .xcworkspace
There will only be one .xcworkspace.
You can install more than one pods in podFile , as Gustavo said , There will only be one Podfile in a project.Create it once and add pods into Podfile whatever you want like :
target 'AppName' do
frameworks
use_frameworks!
pod 'Firebase'
pod 'Moltin'
...
Xcode workspace is a directory (not a file) which has a .xcworkspace extension. Finder shows it as a package. It actually is an Xcode document that groups projects and other documents so can be worked together in your project.
A workspace can contain any number of Xcode projects, plus any other files you want to include.
When you open an XCWORKSPACE, it opens the associated project and restores the perspective. Therefore, Xcode workspace files can be used as a wrapper or container for an Xcode .XCODEPROJ project.
Xcode workspace directory includes a vital XML file named contents.xcworkspacedata, and it looks like:
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MySampleProject.xcodeproj">
</FileRef>
<FileRef
location = "group:OtherProject(for example Pods).xcodeproj">
</FileRef>
</Workspace>
In this arbitrary tree, group: represents the directory of your project/s (as many you have).
Additionally .xcworkspace always exists it may be external to an .xcodeproj, or embedded within one. Therefore, whenever you see .xcworkspace you have to use it to open your project.

Multiple targets for project in xcode

I am using xcode 7.3.1. After pod update, it's showing multiple project target in the project having same details without any change. How can I fix this? If I delete any one of these, xcode crashes and when we reopen even the other option comes in red and we dont have any project.
Have you tried to delete the workspace file and the pod directory, and re-launch a pod install ? The workspace file does not hold any important information to be retained in CocoaPods.
If you have the same problem after regenerating, it means there is an error in the Pod file.

Can I delete the xcodeproj after pod install?

I know that I have to use the .xcworksapce file after I did pod install.
But today, I accidentally opened the .xcodeproj file and the whole project broke! And the problem described in this question occurred.
So I want to delete the .xcodeproj file so that I will never break my project by opening it by accident. Can I do that? I didn't try it because I'm afraid I will break my project again.
No, you can't. In fact the xcworkspace file use xcodeproj file of you project.
The purpose of the xcworkspace file is to make the merge between your project (and its xcodeproj) and the Cocoapods projects (and its Pods.xcodeproj).
EDIT:
If you want to move your xcodeproj to a subfolder (to avoid mistakes), you just have to update your podfile and add:
xcodeproj 'subfolder/yourproject.xcodeproj'
Then, delete your xcworkspace, and do a pod install.
Be careful: this works only if your Workspace contains just your project and the pods.

I can't use Cocoapods to update Podfile

I wanted to open app(UAAppReviewManagerExample),but this demo uses CocoaPods, so I wanted to update Podfile, but it failed. It asks me to find my another app's xcodeproj file in my Mac. What should I do?
You are opening wrong file, You have to open xcodeworkspace and not xcodeproj.
Also check whether instead of deleting files from project, have you deleted the files of dependency from pods. Because according to image you sent, Xcode is unable to find the files on your system, but it is getting an update request from podfile.

Resources