Pod files are missing - xcode

I am new in iOS dev, but I need to build a certain project. The problem is that when I click on the build button xcode fails and one of the errors says
Unable to load content of list : path_to_pod_file
as well I see that in project structure xcode marked missing files with red color
I read about pod files and understood that it is a kind of configuration file, so the question is: are these files should be generated by build (somehow) or it is files that I hadn't received with a project and there is no way to generate them?

I found a solution here:
https://medium.com/#soufianerafik/how-to-add-pods-to-an-xcode-project-2994aa2abbf1#
Actually, the files I asked for above are generated and I needed to install the pod and run the Pod file which (in my case) was under my project structure.
sudo gem install cocoapods
cd PATH_TO_YOUR_PROJECT_FOLDER
pod init (IN CASE IF YOU HAVEN'T ALREADY HAVE IT)
pod install
Double click on the Xcode workspace to open the project
You can clean/re-build your project and run it.

Related

Using 'GoogleMaps' and 'GooglePlaces' pods, when archiving iOS build receive error for multiple commands produce GoogleUtilities target

Having trouble archiving - I receive a Build System Information error that says
Multiple commands produce '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-ac14cd06' has create directory command with output '.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates.noindex/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
I recently updated to the latest version of Xcode (v 10.0). I am also using Cocoapod version 1.6.0.beta.1
Using GoogleMaps pod version 2.7.0, GooglePlaces pod version 2.7.0
When I run 'pod install' it also installs 'GoogleUtilities (5.3.0)'.
I tried deleting my Podlock, Podfile, .xcworkspace, etc and starting over with a new Podfile, pod init, pod install, etc. after updating Cocoapods but still no luck.
I'm looking for a duplicate relating to GoogleUtilities or Places or Maps in Build Phases within Embed Pod Frameworks, but not having much luck. When I look inside the Pods folder, I do see two GoogleUtilities frameworks, "GoogleUtilities-00567490" and "GoogleUtilities-ac14cd06", but both appear not to have the exact same contents.
Only now experiencing this issue after updating Xcode to version 10.0.
For me, the same issue was coming and Most of the people saying to change the build system to legacy, but when I tried its It started swift compilers error. resolved as mentioned below.
Go to your target and click on (your_app_name_target).
Select Build Phases.
Expand Copy Pods Resources.
See the section Output Files.
This section should be empty. Remove any entry there.
Rebuild your Project.
Going to File > Workspace Settings and then changing the Build System from "New Build System (Default)" to "Legacy Build System" will allow you to archive for now. Hopefully, another solution comes along for using those pods and the new build system in Xcode 10.0

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.

Cocoa Pods without workspace?

I have read about a possibility to add CocoaPods to an XcodeProject without getting the xcworkspace file, instead you get a xcodeproj file that you can integrate into your current project. How can I do that? Would love to use the xcodeproj file instead of xcworkspace.. I'm programming in swift (if that makes any difference).
Yes, its possible. But, we need to do few steps to proceed.
Check this Github thread.
The below line in pod.file will not let the client integration process.
install! 'cocoapods', :integrate_targets => false
We can drag and drop the Pods.xcodeproj to the main project
Link the target dependencies and Link Binary with Libraries in Build phases.
Thats it.
You can not do this.
The CocoaPods website guide to using CocoaPods found here directs you to using the .xcworkspace it creates. Several other guides found across the Internet all direct you to use this file indicating that using the .xcodeproj file will now result in build errors.
There is simply no evidence that this is a possibility at all.
From the CocoaPods website guide on using CocoaPods:
Save your Podfile.
Run $ pod install
Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.
More from their website:
Now you can install the dependencies in your project:
$ pod install
Make sure to always open the Xcode workspace instead of the project
file when building your project:
$ open App.xcworkspace
And from the Ray Wenderlich guide regarding using CocoaPods with Swift:
Open the project folder using Finder, and you’ll see that CocoaPods
created a new IceCreamShop.xcworkspace file and a Pods folder in which
to store all the project’s dependencies.
And from an NSHipster article on CocoaPods:
CocoaPods will create a new Xcode project that creates static library
targets for each dependency, and then links them all together into a
libPods.a target. This static library becomes a dependency for your
original application target. An xcworkspace file is created, and
should be used from that point onward. This allows the original
xcodeproj file to remain unchanged.
In older versions of cocoapods it was possible to install and update pods with the option '--no-integrate'. It allows you to create a library project, which could be imported into an existing project (read more). But this option is missing now. I've build a Xcode project for a maven-build with this option earlier. Today I've updated the pods of this project with the newest cocoapods version (1.0.0) but without the '--no-integrate' option and it still works. So eventually there is a way...

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.

How do I configure my project for Cocoa Pods correctly?

In some of my past projects, Cocoa Pods wasn't configured correctly and it would lead to undesirable things such as needing duplicate Cocoa Pod projects in the Project Navigator, or pod files having to be checked in to version control.
How do I install Cocoa Pods correctly and verify that my Directory structure and Project Navigator structures are set up properly?
The best way to use Cocoa Pods is to follow the official example's lead.
This consists of several steps.
Setting up Cocoa Pods for the first time
1. Install Cocoa Pods on your computer
Begin with the Getting Started Guide to install Cocoa Pods on your computer.
2. Create a Podfile
Do not create the Podfile in Xcode, since it should not be part of your project!
Create the file in your favorite text editor, and save it at the same level as your .xcodeproj file.
An example of a Podfile's contents are:
pod 'CupertinoYankee', '~> 1.0'
3. Run pod install
Navigate to your Podfile's directory in terminal and run pod install.
4. Open the generated workspace
Once you run pod install, you will see a message such as:
[!] From now on use MyProject.xcworkspace.
Close the Xcode project, and open up the generated .xcworkspace file.
Understanding the Changes
It is always useful to know what changes were made to your project in case things go wrong.
1. Directory structure
You should have started with a structure such as:
... then manually added a Podfile:
After running pod install, your directory structure now looks like this:
Notice how the only new objects are:
MyProject.xcworkspace
Podfile.lock
Pods
2. Project Navigator
In Xcode, you started with this:
... and ended with this in the new workspace:
For reference, here is an expanded look at the new directory structure:
Obviously, the Pods project was added to the Project Navigator, but there are a few other key things to notice:
Notice how Podfile is located at the root of the MyProject folder in Finder, but is inside of the Pods project in Xcode's project navigator.
Likewise, notice how Pods.xcconfig is located inside the Pods folder in Finder, but is inside of the MyProject in Xcode's project navigator.
3. Configurations
These are the same screenshots as before:
In Xcode, you started with this:
... and ended with this in the new workspace:
Notice how under Configurations, the "MyProject" target now has Pods specified.
This is important because otherwise PODS_ROOT will not be set up properly (among other things), and when you build, you will get errors.
4. PODS_ROOT added
Your target's Build Settings went from this: (Note: this is scrolled all the way down)
... to this:
Notice how PODS_ROOT was added as a User-Defined setting.
Note: this part of the configuration sometimes gets bugged out when reinstalling Pods, so you may need to close and open the Xcode project to fix it.
5. Other changes
You can see a complete list of the changes here.
In my case: On my project SwiftLint was added on Build Phasees -> SwiftLint as below image My root Folder structure was Volume/Project Files/iOS Project Files/Office Projects/project-name. As you can see there were space on my Directory structure , SwiftLint executed on build phase create problem for those space and show a no directory found error. After changing the high level directory by renaming like the below image solved my problem

Resources