I am working with a colleague on a Swift application and we are managing our versions through github. He has added some CocoaPods.
I have run
gem install cocoapods
pod install
The proj/Pods directory is populated with Pods, however on the very first import, Xcode fails to build with No such module Alamofire, and Xcode does not see anything other thenPods.debug.xcconfig and Pods.release.xcconfig in the Pods directory.
How can I resolve this?
You should open .xcworkspace, not .xcodeproj.
Related
I upgraded my Xcode to 12. Everything was working perfectly and all of a sudden I kept getting bellow error message (Image below)
SO link have tried using to solve this issue
SO Link
What I've done so far
Cleaned Build Folder
Restarted Xcode
Updated Cocoapods
Deleted DerivedData
Cleared pod cache
Deleted pods directory and file and reinstall
None of them worked and its getting frustrating.
Pod file
All I did was to follow the instruction(see image below) and it got fixed.
Source here
I had the same problem with a project still targeting iOS 8 as the minimum iOS version. This steps solved my problem:
Update minimum target iOS version to iOS 9 on Podfile file;
Open terminal on project folder, remove all pod file dependencies and update them by running:
rm -rf /Pods
pod repo update
pod install
Update minimum project target iOS version to iOS 9;
Remove DerivedData;
Clean project;
Compile/run project again.
A simpler solution is to update cocoapods to the 1.10 version
First, update the CocoaPods installation :
[sudo] gem install cocoapods
Then, update your project : bundle update cocoapods
Finally, run pod install and everything should be OK :)
If the previous solutions did not help someone, then try changing it this way:
#include <nanopb/pb.h>
->
#include "nanopb/pb.h"
This issue CAN be the result of developing iOS on an M1 (Apple Silicon) machine. In this case, the only way to fix the problem is to download a Ruby extension called "ffi" which you can read about here (for extra information): https://rubygems.org/gems/ffi/versions/1.0.9
To do this:
In Terminal, install ffi onto your machine using this command:
sudo arch -x86_64 gem install ffi
Then in your project file, install your podfile with this command:
arch -x86_64 pod install
This should allow you to install your pods (especially if you were getting a "zsh: abort pod install" problem. Notice Terminal will warn you "a bug in the Ruby interpreter or extension libraries".
After this, if your pod was FireStore/FireBase you may have to get another GoogleService-Info.plist file in your project.
I am trying to run an ionic app on xcode. But xcode throws an apple match-o linker error. I get this error, when I get this after I have runned the following command:
cordova plugin add phonegap-plugin-push --variable SENDER_ID=5****** --save
I need this plugin, for push notifications. After a research on google, I founded that I need to have Cocoapods installed in the projects. But after installing Cocoapods & pod install. I get the following error, when I start the "project.xcworkspace".
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I tried to rebuild/clean project or install pod again. But it did not fixed for me.
Can someone help me?
EDIT -> new Error
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am getting this error, when i have fixed the error with pods.
If you are setting up environment setup in your project, you have to choose corresponding pods target in configuration.
Update your CocoaPods installation first ("sudo gem install cocoapods")
then remove everything related to POD from project directory except .podfile.
Run "pod install" on terminal and open your project using workspace file.
1- Remove PODS folder from project folder and then perform pod install and open project using .xcworkspace file.
If above one don't work, go to Xcode Build phase and check for path in scripts added by PODS(usually with pods word in there title), sometimes for hybrid project the path was not correct for podfile.lock and manifest.lock file lookup in the script.
Easiest Solution which worked for me:
Open terminal inside your project directory
Change directory to 'ios' (cd ios)
Type 'pod install' and wait for dependencies getting downloaded and installed
I hope this will help someone out!
In my case, I updated cocoapods and the problem was solved.
gem install cocoapods --user-install
My case, Please:
Xcode → File → Workspace Settings.
Make sure in tag: Build System → New Build System.
Please copy your Podfile.
Delete Podfile, Podfile.lock, Pods Folder in your root app folder, like this.
Next Step, Open <YourProject>.xcodeproj. You should use Terminal by:
open <YourProject>.xcodeproj. (Remember not .xcworkspace)
In Pods tag, delete these files, like this:
<Pods-YOURPROJECT>.debug.xcconfig
<Pods-YOURPROJECT>.release.xcconfig
Pod init and Pod install your Project again.
Open <YOUR PROJECT>.xcworkspace, with Terminal: open YOURPROJECT.xcodeproj
CMD+SHIFT+K to clean build.
CMD+B to build again.
Enjoy
Last year I had used the similar plugin, when I was working on an App Update, I came to know that this plugin got deprecated. Not sure about the above one.
So I've working using FCM. I had the similar problem while working with FCM. After having spent nearly a day on researching on this I've found a cordova plugin which takes care of pods in cordova.
Plugin name:
cordova plugin add cordova-plugin-cocoapod-support --save
Please Note: After installing this plugin, there's no need of podinit, or opening the pod and installing it. This plugin will take care of it. It will create a AppDelegate inside the plugin folder where it will handle everything - you can retrieve Push Token as well in DEV mode if you wish.
After I installed this plugin and build iOS, there were no issues.
** Note **
Please ensure while working with FCM, no other google plugins are installed, they'll conflict. Earlier I had GoogleAnalytics plugin, as it's now covers within FCM - you can remove Old GoogleAnalytics plugin in order to work with FCM without issues.
For my Cordova project doing pod init in the ios folder fixed the issue.
From your Cordova project root directory you would:
cd /platforms/ios
pod init
cd ../../
cordova build ios
I have create 3 project target (Development, Production and Staging).Expect Production other working fine after pull the changes of others while building the production target xcode giving the error :
gone through some of the available solution but no success!!!
If you change something the conflict will be occur, do like remove your WorkSpace once and again install or update your Pods,it will Work
Run pod install or pod update your CocoaPods installation.
For additional Information see this1
Choice-2
there's a problem with Cocoapods in your project. Sometimes cocoapods can get out of sync and you need to re-initiate cocoapods. You should be able to resolve this error by:
Deleting the Podfile.lock file in your project folder
Deleting the Pods folder in your project folder
Execute pod install in your project folder
Do a Clean in Xcode
Rebuild your project
Conclusion: don't run pod install while project opened in the Xcode.
Update answer
I. Project Cleanup
In the project navigator, select your project
Select your target
Remove all libPods*.a in Linked Frameworks and Libraries
II. Update CocoaPods
Launch Terminal and go to your project directory.
Update CocoaPods using the command pod install
I have solved my problem by this way :
After implementing lot many solution i got this error :
By removing Check pods manifest.lock, Copy pods resources and Embed pods frameworks from Build Phases of Tests project target(xxxTests) i solved the issue.
NOTE: If any one still getting any issue related to pods, then try to remove libpods-xxx.a from Link Binary with libraries and again add it.
The Problem
I recently started working on a project.
Which Uses Cocoa Pods as the dependency manager.
It also uses Crashlytics for crash reporting.
Image Magick for Icon generation and Synx for reorganizing the project folder.
I was given Git access.
So I cloned the repo.
did a pod install
and compiled the code but it started giving me following error.
Project target is iOS 7.
Cocoa Pods Version is 0.36.4 also tried Latest 0.38.2
It is an iphone only app.
What I have done So far trying to solve this issue
So I sat down with the Original developer who was very helpful and had a working copy of the code on his machine. As it was a code handover so he was helping me setting it up on my machine.
We have tried all the usual suspects.
Clean and Build
Clean Quit Xcode Reopen and build
Quit xcode delete the Pods Directory and do a pod install
pod setup
pod update
Checked PODS_ROOT paths for different build configurations with working copy on another machine where it compiles correctly
My pods were latest so I uninstalled cocoapods using sudo gem uninstall cocoapods and installed the version the original developer had sudo gem install cocoapods -v 0.36.4
Matching Xcode versions xcode 6.4
Checking Configurations under Info in Project
Another pull from Github at a different location and doing all above steps.
Clear Xcode derived data folder.
So basically we checked all this retried all the above steps many times and also verified project settings build phases etc.
code is running fine on his machine.
Some weird behaviour i noticed was that one time instead of above mentioned error in picture it gave the famouse xyz.h file not found error for one of the libraries in Pods. But doing a pod install reverted back to original error.
Any ideas?
I remember this one.. I think it is due to cocopods changed the directory of there "copy pods resources" shell script from one version to the other. Look under your targets build phases and check for a "run script" entry i think. Look at the path and then check in finder to see where the shell script is really located.
Not really certain of the details... it might have been one of the other cocopods enters in the build phase section. Look around there, I do remember it was pretty easy to spot when you know where to look.
Should probably be the "Check Pods Manifest.lock" section under Build Phases.
Make sure you are opening workspace project(.xcworkspace) instead of XCode Project..
Else
Remove podfile.lock
Remove Pods Folder
Remove .xcworkspace
Remove manifest.lock (if exists)
Go to path of pod file and Run pod install
Then it will generate .xcworkspace.
Now onwards you need to use workspace instead of xcodeproj
Hope it helps you..!
I am using XCode 4.5.1 and iOS 6.0 base SDK.
Here is the error I am receiving:
i686-apple-darwin11-llvm-gcc-4.2: /Users/fahim/Library/Developer/Xcode/DerivedData/Currenthiphop-emodxxwwaiojlcboaxuodksuwuww/Build/Intermediates/PrecompiledHeaders/Pods-prefix-evibdktwbatdnbabmrlnderfsxxi/Pods-prefix.pch.dia: No such file or directory
There is only 1 file in the Pods-prefix-xxx directory:
Pods-prefix.pch.pth.hash-criteria
Here is my Podfile:
platform :ios
pod 'LibComponentLogging-Core'
pod 'LibComponentLogging-LogFile'
pod 'LibComponentLogging-qlog'
pod 'LibComponentLogging-pods'
pod 'Facebook-iOS-SDK'
pod 'RestKit'
Any help is appreciated. Thank you!
I actually found this solution right here that details opening up Xcode using normal means (Finder or the Dock), as opposed to using the open <Workspace>.xcworkspace command. I've always used Xcode from my dock, whereas the other developer (who couldn't build the project and was getting the error you were) was using the open command from the command line. Once he opened Xcode from the Dock, and manually browsed to open the project that way, he could build it successfully.
If you are using CocoaPods 0.18.0, this might be cause by CocoaPods and is fixed in https://github.com/CocoaPods/CocoaPods/issues/956
Extra quote in "$(inherited)" was the cause (https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/generator/xcconfig.rb#L150). It should not be quoted. If you remove them from the xcconfig the project will build again. You may want to check your xcconfig and see if there are extra quote.
This issue can be caused by a few different factors but in my case and the case of some colleagues, this resolved the missing pch.dia
Uninstall CocoaPods and install 0.17.1
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 0.17.1 --verbose
Lock your Kiwi version to 2.05 if Kiwi is one of your pods:
target :KiwiUnitTest, :exclusive => true do
pod 'Kiwi', '2.0.5'
Clean your Xcode project including Derived Data. Close down Xcode, re-open the project and build.