Unable to install pods using a legacy Cocoapods version - ios

Working an a iOS project and don't have time to fix potential pod conflicts, getting the following error when running 'pod install'
The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
Using --no-repo-update flag seems to help but throws another warning
https://github.com/CocoaPods/CocoaPods/issues/6163
Unable to find specification for
... manually replaced te pod master repo .. but didn't work ..
Unable to find a specification in CocoaPods
Being forced to use the latest version ... (--verbose .. also states that I need to update)
when running pod install I get The `master` repo requires CocoaPods 0.32.1, try updating but still in 0.31

As iHulk states in his comment:
Use source "https://github.com/CocoaPods/Old-Specs" at top of your pod file

Try this command in your terminal
sudo gem install -n /usr/local/bin cocoapods

Related

Could not build module 'nanopb' error in Xcode 12.0.1

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.

pod update is resulting into error [fatal: unable to access]

After running pod update I am getting this error, I can only think of internet issue but my internet seems working fine. And another thing I noticed it is not happening every time, sometimes it just work fine with the same Pod file and some time result into mentioned error.
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': transfer closed with outstanding read data remaining
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
its mean the latest pod not updated yet on git , wait 2 or 3 days it will work until you can add .framework file in your project or can use one down version of pod like latest pod is 10.2 so you can use 10.1
Repo updated but git not update. Check this link click.
Reinstalling CocoaPods:
sudo gem install cocoapods
Once it will be finished then write below command:
pod install
If pods were already installed. Otherwise, you will have to update all of them with
pod update
open your terminal go to your project i.e cd your_project_path hit enter and then run this command
pod repo update --verbose
hope this will resolve your issue
for more info check this link it might help you

Cocoapods subspec issue: None of your spec sources contain a spec satisfying the dependency

I modified a repo on Github to integrate a swift version of my library.
https://github.com/iDevelopper/PBRevealViewController
However when in a new project I try to pod install I get the error:
[!] Unable to satisfy the following requirements:
PBRevealViewController/Swift (= 1.2.3) required by Podfile
None of your spec sources contain a spec satisfying the dependency: PBRevealViewController/Swift (= 1.2.3).
You have either:
* out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.
Some helps are welcome!
Please see the Cocoapods issue:
https://github.com/CocoaPods/CocoaPods/issues/6970#event-1213956994
If you're using Macbook with M1(apple silicon)
Inside your ios Folder follow these commands in terminal
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
If this still don't fix your issue then run
arch -x86_64 pod install --repo-update
I am not familiar this, but I also faced the same issue I followed the few steps
delete your podfile and regenerate your pod file once again use the following steps,
pod repo remove master
pod setup
pod install
You can try to delete Podfile.lock And then run pod update
I have been struggling with a similar issue for days now and it turned out that the pod that I was trying to include as a dependency is not a valid Repo for CocoaPods I mean the repo is a correct GitHub repo but the problem with it is that it only has a podspec in the root of the project and is missing the CocoaPods specs repo structure.
If you read the CocoaPods official guide it might not become obvious what they mean but once I started looking through a specs repo it just clicked.
If you check the example they have given then you will see that you need a different GitHub repo separate from your pod's repo with all the podspecs listed in it. Have a look at their example repo Artsy
You can see what I mean.
What I had as a misconception was adding the source of the single pod at the top of my Podfile, but rather it would have to be the source of a whole specs repo which has to be created separately as I mentioned above otherwise pod install won't be able to find the subspecs as the repo is incorrect.
After the explanation and looking into the Artsy repo I mentioned above I hope that re-reading the CocoaPods doc will make much more sense as it did to me :)
I hope this helps.
I try to give an example of how the Podfile should look like with the correct source:
# The source below won't work if you integrate it as a dependency
source 'https://github.com/iDevelopper/PBRevealViewController.git'
# Instead create a new specs repo as per the info above and include that
# Similar to the one you already have here
source 'https://github.com/iDevelopper/RWPodSpecs.git'
#use_frameworks!
platform :ios, '9.0'
workspace 'PBRevealViewController.xcworkspace'
target 'PBRevealViewController_Example' do
pod 'PBRevealViewController'
end
updating pod version to 1.11.3
Run "pod repo update --verbose"
ios / "pod install"
worked for me !!!

cocoapods don't generate workspace

I'm quite New to ios and cocoapods.
I am using realm.io swift version. Everything is latest version including xcode, realm and cocoapods
I did it with dynamic linking and realised itunes don't accept the strips framework.sh ...so I try using cocoapods. I didn't remove the dynamic linking and followed the steps using cocoapods to install realm.
It generated the workspace file for me and the running keeps telling realm object can't be found though I have import realm.
So I decided to remove the previous dynamic linking and install cocoapods to start all over again.
Now cocoapods don't generate workspace for me.even a new project that I created.
I tried all the comments to remove pod, cocoapod and even clone the cocoapods etc but nothing works
Please help. Why it don't generate workspace for me anymore
I followed these steps but still don't work
https://teamtreehouse.com/forum/pod-install-error-in-terminal-not-creating-xcode-workspace
Just copying from the comments: the answer was to specify use_frameworks! to the test target.
I was getting an Abort:6 error during the Generating Pods project step of pod install.
I deleted the Pods folder, reinstalled Cocoapods, ran pod install again, and it worked.
Reinstall cocoapods:
sudo gem uninstall cocoapods
sudo gem install cocoapods
I used all of the given solution and get success.
First got to Product->Scheme->ManageScheme and then check the shared box(Selected Form)
now pod install
if problem still arise
Try this
pod setup
pod install
if still have problem.(this worked for me)
rm -rf ~/.cocoapods
pod setup
pod install
if problem still there then last but not least
rm -rf ~/.cocoapods
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod install
If you've done all the above steps and if it's still not working, try
pod install --repo-update
I tried all the above steps, and still it was generating pod folders with blank dependency names. This step should download all the required dependencies for your project and will also create the .xcworkspace
To generate a workspace you must have the installer line in your Podfile saying:
integrate_targets => true
like this:
install! 'cocoapods', :integrate_targets => true
If you are using frameworks you do not need the workspace generated.
Try adding
use_frameworks!
between the platform line and the target line, then redo pod install from your terminal.
I did
rm -rf ~/.cocoapods/repos/trunk/
After that it worked again.

CocoaPods was not able to update the `master-1` repo

I user cocoapods update libs in china, the network of my county is limited.
so...
Podfile add one line : "pod 'SQLCipher' "
I run :
pod install --no-repo-update
failed!
remove 'pod SQLCipher'
run:
pod install --no-repo-update .
error:
[!] CocoaPods was not able to update the `master-1` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
run:
pod repo update --verbose
loading... forever
Looks like your specs repo was edited at some point, and now git can't update it.
I'd recommend deleting and re-creating your Specs repo;
Run below command:
pod repo remove master
and then setup new by running
pod setup
I had found problem. I import 'SQLCipher' by add 'SQLCipher.h' 'SQLCipher.c' files.
then Error.
solved by remove the two files.

Resources