Why can't i install my newly created CocoaPod? - ios

I created a framework and wanted to distribute it via CocoaPods. For that I published the code to CocoaPod's Specs github repository (https://github.com/CocoaPods/Specs.git) using the command:
pod trunk push RXSStoryblokClient.podspec
The pod was successfully pushed to the trunk (https://github.com/CocoaPods/Specs/commit/b0a141b3c741d757090f61d1579ec92a7c0ebfb6) and on the outside everything seems to have worked. But when I create a small test project and try to install the newly created pod by adding it to the podfile and running
pod install
it tells me: Unable to find a specification for 'RXSStoryblokClient'
I have tried (as suggested by cocoapods) to update the repo using the
pod repo update
command, but this didn't resolve the issue.
Any help in this matter would be greatly appreciated!

The issue actually resolved itself. It seems CocoaPods had not finished some indexing work and 48h after pushing the pod spec to github, the installation finally worked.

Related

Newly submitted Podfile won't install with pod install but instead installs with pod install --repo-update

I have created a new iOS framework in which I listed external cocoapods as dependancies in my podspec file.
I successfully ran podspec lint without warnings/errors and then pushed the trunk which was also successful.
I read in several places that it usually takes up to an hour to show up so after 2 hours I tried to integrate the pod into a demo project using pod install, it gave me some errors like:
This pod might no longer be available
There could be an issue with the repository link
The name of the pod might be invalid
All of which I disagree to. So upon further research, I saw some people even had to wait for 7 hours as they had quite a heavy project, however, my library is not too heavy and it's dependancies are quite heavy but since they are not included in the project itself, I was wondering why it took so long.
Then I came across another pod install command pod install --repo-update which I ran seconds after pod install failed and it installed my pod and all of it's dependancies.
So I am curious to know what is the difference between these commands and how come one worked and the other did not ?
Thanks
pod install --repo-update and pod update update your local copy of the centralized CocoaPods Specs repository with the latest version.
pod install will use the previous local copy on your machine.
If a pod publisher published a new version after the last time you updated your local copy, pod install won't have access it to it. That's why you need to specify --repo-update.

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

What does Pod Repo Remove Master do?

So I am very new to CocoaPods and I want some clarification on a command.
I had an error that said Unable to find a specification for 'Firebase/Core' and after multiple tries of different commands the only thing that worked was Pod repo remove master. Can anyone tell me why that worked and what it did?
The Master(Specs) Repo is the repository on GitHub that contains the list of all available pods. In case it is broken or not up-to-date you might face issues while installing or updating your pods.
By pod repo remove master you removed the master repo which might be broken or not up-to-date.

Admob pods do not work after firebase integration

As you may be aware of it, Google now switch to Firebase instead of Google Analytics. So I tried to integrate it to my current working project. Admob is also integrated to my project with Pods.
I have followed Google's document and created a new pod and re-install with firebase. After it , now my project does not build.
Here is error
Use of unresolved identifiers "GADBannerView"
Try switching your imports to just:
#import GoogleMobileAds;
Everything should work as it was before, but using the module map is a great a way to pull in the headers rather than directly importing.
I have resolved it with:
-delete all pod related files from my project folder
-pod init
-re-add my required pods
-pod install
So I get this error as well with GADRequest errors even on Google's sample Banner project.
I fixed it with #Ian Barber's suggestion with #batgun's answer, of updating cocoapod version to 1.0.0 by running
$ [sudo] gem install cocoapods
https://guides.cocoapods.org/using/getting-started.html
then deleting all cocoapod items then install them again.
When I was in cocoapod version lower than 1.0.0, when I run pod install again, I still had errors, like "Use of unresolved identifier 'GADRequest'"
I retyped the whole thing and worked perfectly. When I was still not in cocoapod 1.0.0 version (i think it was 0.39 version), I can only find GADRequestError and not GADRequest.
When I retry extracting the original project now, do pod install and run the app, It doesn't throw any errors now.
I believe this has something to do with cocoapod version but it is not in google admob instruction to update it on.
I was trying to figure this out since the day of the release and losing hope for firebase because it was the sample basic banner project and it doesn't work!
VERIFIED!
I can verify it has something to do with cocoapod version.
I was trying to do the Google's Codelab 'FriendlyChatSwift' practice project since the release and throws a bunch of errors after running pod, not finding bunch of classes.
Steps:
$ [sudo] gem install cocoapods
I deleted the existing downloaded pods and related (ProjectName.xcworkspace, PodFile.lock, /Pods)
Run pod install
Build and Run of the project
It worked perfectly. I also tried running the project before doing this steps and It had bunch of errors.
I had this same issue and this helped me get setup the way I needed it but I don't think anyone touched on my exact issue. Thought I'd provide that just in case someone was looking.
After I cleared everything out and ran pod init I noticed that the generated pod file has use_frameworks! set in it. Once I added that everything was solved. Stupid mistake on my part since you need use_frameworks! for swift projects but leaving that out lead to a lot of random not found errors showing up and going away at random. Hope this helps someone.

podspec specification does not validate

I'm trying to create a cocoa pod following this tutorial. I'm stuck at the moment where I'm doing the following command:
pod repo push RWPodSpecs RWPickFlavor.podspec
the problem is that I've got the following error:
Validating spec
[!] The `RWPickFlavor.podspec` specification does not validate.
And not further error description unfortunately. What I tried was reinstalling cocoapods and installing cocoapods keys, but it didn't help. I'm still getting the same error. Any ideas, guys?
I solved this issue by adding option --allow-warnings.
While the OP's issue was fixed, using this command will give more information about anyone else's issue. For me, I forgot to push the new version tag to my remote.
pod repo push [repo] [podspec] --verbose
Oh, the problem was very simple actually. I was simply being unobservant. In my .podspec file I had one of the urls formatted like that : ["https://github.com/Andrey-C/RWPickFlavor.git"]. Once I removed the square brackets around the url the error vanished.
Sometimes pod spec lint doesn't update changes (this is because of cache).
Once I fixed some errors specified by lint, pushed, updated tag, etc., and ... got the same errors as before.
So you can fix it by cleaning cache:
cd /Users/<#your-user-directory#>/Library/Caches/CocoaPods/Pods
just delete /Pods directory and pod spec lint will work again
For me, I needed to add a revision tag to my master branch and then git push with all tags before the pod trunk push would pass validation.
Use the following command:
pod trunk push RWPickFlavor.podspec
It publishes your newly created pod to CocoaPods repository, creating a pod with name that specified in your .podspec file.
You also have to use such command to publish a new version of your pod.

Resources