Cocoapods No Source Files After Install - xcode

I did a straightforward pods install into an existing Xcode project. When I open the xcworspace file, all I see is:
What I see in when I open xcodeproj is:
How can I fix this so I can see all my folders when opening xcworspace?

You can't have both the project AND the workspace open in Xcode at the same time.
Go into Xcode, close both the workspace and the project, then only open the .xcworkspace file and you will be able to click the disclosure triangle next to the xcodeproj and list those files in the file IDE along the left side.

Related

How do I archive Xcode project?

I am currently having issues when attempting to archive my project in Xcode. The following error below appears when archiving:
The link Xcode 12 Error: Multiple commands produce AccessibilityResources.bundle mentions to remove React-Core.common-AccessibilityResources from my target but I do not have this under my target. Can someone please assist?
I am using Xcode version 12.1.
This is what I have in the workspace settings:
Thank you.
I changed the derived data location but still getting the same error:
I am now seeing the below error after updating my Podfile.
Current error:
Updated Podfile:
Have a try with the below solution.
Initially clean the build cache data with the below steps:
You can go to File > Workspace Settings if you are in a workspace environment or File > Project Settings for a regular project environment.
Then click over the little grey arrow under the Derived data section and select your project folder and close the workspace and Xcode then delete the project directory from the derived data directory.
Open the workspace again in Xcode and clean and rebuild the project.
Also, make sure that you have applied pod install after the package installation.
Then, open workspace and set the active scheme as Any ios Device (arm64, armv7)
Click on Project from top Xcode Menu
Then select Archive.
Have a break till the Archive process completes.
Remove the below lines from PodFile:
use_flipper!()
post_install do |installer|
flipper_post_install(installer)
end
and do pod install in ios directory.

Is it necessary to close Xcode project when installing pods?

Let's say I want to install firebase pod, I add it to Podfile, next I have to run pod install at the terminal, is it necessary to close the project?
If you have the .xcodeproj file open, yes. You need to close it and then open the new .xcworkspace file after cocoa pods has done its thing.
If you have a workspace already you theoretically don't need to close it but I generally do to keep Xcode from being grumpy.

.xcodeproj file within .xcworkspace created through cocoa pods is disabled

I look through the internet I didn't find the answer so here is the problem
I had a project that I used cocoa pods in it and so open it through workspace file that cocoa pods created for me, but after update my os (clean install) to MacOS Sierra the .xcodeproj file is disabled when I open the project within .xcworkspace and every file underneath is not showing, I had many files grouped into Xcode folders under .xcodeproj 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.

Source Control - Discard all changes deleted my xcworkspace and I can't fix it

I was trying to undo changes on my project to the last committed Source Control state, however when I pressed 'Discard all changes' weird behaviour happened.
The first time some of the files reverted whilst others didn't. So I pressed the button again and a blurb popped up saying something about needed to re-save the 'xcworkspace'. I pressed okay and half my files disappeared from the xcode file list on the left, really random files that hadn't been edited at all. So I decided to press revert again to see if I could get back to my original state, and now all my files have disappeared from the xcworkspace. So my screen now looks like this:
I have tried restoring the files from my trash (as this is where random ones have appeared) but the workspace is never restored. I use MapBox so I have 2 projects building in to 1 workspace, but the podfile will now not install.
Can anyone give me advice on how to get this back to it's original state as I have been trying for a few hours but can't find any information.
I felt horrible when I did this. I really thought I had to rebuild everything over again. Luckily, it was easy to repair.
Xcode removed all the "non-essential" files. This includes your Podfile (and if applicable, GoogleService-Info.plist).
To Repair:
Go to Terminal and create a Podfile in your project folder $ pod init
Update your Podfile with the pods you need
Run $ pod install
(4.) To re-generate the GoogleService-Info.plist file, go to your console.firebase.google.com > Settings > Project Settings > Download the latest config file for the appropriate project iOS app and save to your local project folder. Your workspace should recognize the file in the Project Navigator list.
Once you open your workspace, select new Scheme and everything should be back to normal.
To avoid future regressions:
Go to Terminal
git add -A
to add the pod files, then
git commit -m "Save pod files"
to save pod files. I believe git from Xcode ignores the pod and scheme files.

Resources