Somehow every time I run pod install or pod update, my project dependencies are downgraded.
And if I explicitly write the project version, the pod install does not work.
Running the same pod file on another computer works fine.
Here is my pod file and my command line screen.
The solution was to use.
$ pod setup
Related
The bounty expires in 3 days. Answers to this question are eligible for a +50 reputation bounty.
Oscar A Garcia wants to draw more attention to this question.
A coworker and I are taking over an iOS app hosted on GitLab. This app utilizes cocoapods, and the Pods directory is included in the repo. My understanding is we should be able to pull the repo and run it on Xcode without issues.
My coworker is able to download the app from source control and run it on his machine. Mine is getting errors such as "Cannot find type 'AnimationView' in scope". He is running an M1 MacBook, I'm running an intel-based MacBook air. I'm opening the workspace file that was generated by CocoaPods, not xcodepro.
Here's a list of things I've tried:
Regenerating the pods via the command line by running pod reintegrate, then pod update, opening Xcode and cleaning the build folder, and then running again.
Changing the minimum iOS deployment target on Xcode to the highest deployment target of the pods in my podfile.
Changing the architectures on the app build settings to i386 and x86_64 rather than the default.
Clicking "Update to recommended settings" when Pods throws a warning.
None of these seem to work, I'm at a loss at this point. Since it runs on my coworker's machine I'm assuming there must be something wrong with how my app is detecting the libraries or how it's compiling.
Here's my podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
target 'projectname' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for projectname
pod 'Purchases'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'SwiftyJSON'
pod 'CleanyModal'
pod 'MagicTimer'
pod 'lottie-ios'
pod 'FBSDKCoreKit'
end
I suspect the problem is not related to pods.
The reason for this is if you start a fresh iOS Xcode project, called emptyproj, and then close the iOS project in Xcode, you can then go to that project directory and place in a Podfile into that directory with your above contents but with the name projectname replaced with emptyproj, you can then do
pod install
and then once it has created emptyproj.xcworksapce open it in Xcode.
You will notice that there is no symbol called AnimationView. There is only LottieAnimationView.
So the missing symbol must be in the actual app on GitLab, not the pod dependencies.
What I suggest is to look at any build phases in the build of the project to see if any scripts that are architecture-specific get run.
Another debugging strategy is to get your co-worker onto your machine and do the setup herself on your machine, which might succeed (an unmentioned step) or fail (stronger evidence that it is a machine or architecture related matter).
This looks like you have different version of lootie , ask your coworker to check version he is currently using
for this you can use command:
pod outdated
When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock
then
use pod with specyfic version like this:
pod 'lottie-ios', '3.5.0'
instead of:
pod 'lottie-ios'
If you didn't add version when you run 'pod install' you will get newest available version.
and AnimationView is part of lottie liblary.
After adding version number run 'pod install'.
In such a case you can ask for the Podfile.lock of your co-worker and can check for the already installed specific version of the relevant pod, and if there any mismatch with there installed version with yours, update your pod file by adding that version and then pod install. and also if you guys don't need to work with latest version of the pods it is always better to use pod with versions.
I am using Xcode 10.3, If I install one pod,It is installing but previous pods are updating.Tell me way to install pod without updating remaining pods.
You can set exact version to old pods like pod 'IQKeyboardManagerSwift', '3.0'. You can list versions of current pods using cat Podfile.lock.
It should be sufficient to run pod install. Unlike pod update, it will read the Podfile.lock to keep existing Pods at the same version.
I have deleted RoundCornerProgress Pods from Pods library in Xcode but after that when I run the project it shows this error. How can I resolve this problem?
Try using pod install --no-repo-update command.
Remove the pod that you don't need from your pod file and then run this command.
This command will essentially remove the unwanted libraries without affecting other dependencies. Clean and build your project after doing this and it should work fine.
Use pod deintegrate to remove all traces of CocoaPods from the Xcode project.
I am trying to install cocoa pods into my project, so followed installation of pod file setup. So, latest pods installed to my system.
When I tried to install pod file to my project throwing following error.
But, pod file create with blank.
I have given following command and getting following error :
MacBook-Pro:Videos username$ pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client projects
[!] Could not automatically select an Xcode workspace. Specify one in your Podfile like so:
workspace 'path/to/Workspace.xcworkspace'
And I tried Pod init also, if I try to open pod file, its showing empty pod file. And not even showing Target which is default pod file setup.
Anyone suggest me, how to fix this.
This is the general approach while installing pod. Make sure you follow these and it should work fine (I am assuming cocoa pods are installed on your system) So your issue lies in one of the following steps:
Go to the project root directory - cd root_directory_path
pod init
Open pod file and add required pods (See library installation guide. Each has one)
pod install
Empty pod does not get created usually. But even if it does, you can just copy the format of pod file contents into your file and install the pod.
As to your empty pod file, reinstall cocoa pods on your system. Also make sure pod is uninstalled from project/workspace you are working on. There might be a faulty installation earlier.
I found these tutorials to create our own cocoapod:
https://guides.cocoapods.org/making/making-a-cocoapod.html
http://code.tutsplus.com/tutorials/creating-your-first-cocoapod--cms-24332
but for me none of them helps, as they create fresh xcode project using pod lib create. I have my own xcode project and I need to setup in that rather than create a fresh one.
1.Delete following files/folder that pod created.
2.Make sure your Podfile available.
3.Use this command:
pod install
Updated
If you didn't have installed pod in your project. Do like following:
1.Use pod setup in your project root folder.
2.Edit Podfile
3.Use this command:
pod install
Try to do like this:
1.Run the command on Terminal:- sudo gem install cocoapods
After successfully install CocoaPods
2.Go to that folder where your existing project is saved in your System.
3.After that Run the command for creating Pod file:- Touch podfile
4.After Creating Pod file run the next command:- Open podfile
It will open pod file and here Put the below line and save that file using command+S
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 2.0.2’
5.After that run the final command in your Terminal:- pod install
It will take some time to install that file after that once install the all file close the xcode project and again open that project, click on the .xcworkspace extension file.