I have an iOS application.
I'm using CocoaPods.
I have a podfile with all my pods names.
I want to check changes made on one of the pods in GitHub, but I don't know how to get to my projects page.
How can I find the exact project from my podfile in GitHub?
For example -
One of the pods is GoogleAnalytics, searching "GoogleAnalytics" on GitHub will find multiple results with this exact name written by different developers.
How can I find the GoogleAnalytics from my podfile?
Writing the pod name on CocoaPods will get you to the specs but will not get you to the projects GitHub page.
See the source line in the podspec.
The GoogleAnalytics pod is a binary framework only and does not make its source available on GitHub.
Google analytics was just an example, but after #Paul Beusterien answer I understood that some companies sources may not be available on CocoaPods search, that made me search for the smaller independent developer pods, there I have found links to GitHub.
So the answer - if it helps anyone -
Search on CocoaPods for the links to GitHub, if you can't find it, it's probably big enough to find on google or on that dependency's website.
Related
Is it possible to install GoogleMap SDK via Carthage?
I only saw the tutorial for Cocoapods only.
Or I only can install manually if I am using Carthage?
According to Carthage docs:
The only supported origins right now are GitHub repositories (both GitHub.com and GitHub Enterprise)
Carthage actually builds binary framework from the sources it checkouts from the specified repository. Developer needs to link this built binary frameworks to the project afterwards.
Google already provides you with the binary version of GoogleMaps framework instead of sharing sources. Therefore all you have to do is just download this binary from official website and link it to your project without using Carthage. So you can say that Google has already done Carthage work for you so you don't have to use Carthage to build GoogleMap framework. And I believe you even couldn't if you want to because GoogleMaps source code is not open.
Hope my answer will be helpful for you.
Carthage supports linking directly to binary assets.
If you go to the "Manual Integration" section in the documentation page, you'll notice the download link looks something like this:
https://dl.google.com/dl/cpdc/d308af63f78a5a1a/GoogleMaps-3.1.0.tar.gz
So all you have to do is create a local JSON file called something like GoogleMaps.json, and put the following in it:
{
"3.1.0" : "https://dl.google.com/dl/cpdc/d308af63f78a5a1a/GoogleMaps-3.1.0.tar.gz"
}
Then, in your Cartfile, add:
binary "GoogleMaps.json" ~> 3.1.0
Voila!
Was just about to find out how to improve upon Shai's answer. You can simply add
binary "https://googlemaps.github.io/google-maps-ios-utils/GoogleMapsSDK-iOS.json" ~> 3.8.0
into your Cartfile
I used Leone Parise github repo for google maps 2.7 https://github.com/leoneparise/GoogleMaps-Carthage
He has Google Places and Google Place Picker too, but not up to date. If you want to use those, I've them uploaded to 2.7 version here:
https://github.com/danitinez/GooglePlaces-Carthage
and here
https://github.com/danitinez/GooglePlacePicker-Carthage
Cheers!
I'm trying to create a private pod which uses Google Analytics. I include GA trough CocoaPods with pod 'GoogleAnalytics' but it keeps on failing with the transitive dependencies error.
I know there are already a lot of questions regarding this subject, but none of the solutions offered worked out for me.
Looked at Google's analytics site, but that didn't work out. I've seen this closed GitHub issue and scanned this dicussion.
Briefly looked at this small paragraph, which also clearly passes down the transitive annoyance to GA. At the bottom of the paragraph they say:
This eliminates the transitive dependency from the App -> Segment-GoogleAnalytics -> GA to App -> GA.
And of course, checked SO as well.
A little background info:
I use Cocoapods version 1.0.0
My podfile has use_frameworks! (I need that because I use Swift)
I include the GA pod with pod GoogleAnalytics
I also tried it with Google/Analytics and Google/Analytics ~> 1.3
Also tried adding pod Google before the GA pod
and not that it matters, but:
My Xcode version is 7.3.1
Some solutions say that I need a Cocoapods version after 0.36, and that the use of use_frameworks! should fix it. But as far as I know, and see in the generated Pods project, the GA pod still has a static lib (libGoogleAnalytics.a) and no framework.
This discussion has a lot of opinions and solutions, but as I already said, none work for me. Moreover, at the bottom someone said that this is a Cocoapods issue rather then something Google should fix (something with Cocoapods not taking use_frameworks! into account). But I beg to differ, especially since all other pods give me a framework as they should.
I had the error before when using OpenSSL, but fixed that by adding a compiled OpenSSL framework manually to my pod.
So I'm at a loss now. As for how I can fix this...got no clue whatsoever.
Edit
For now I've sort of circumvented the problem by using Carthage with the framework generated here.
I'm working on pods development for an iOS dev team (on private repo). My low-level C/Obj-C core pod contains a static library with some headers and is used as dependency in other pods (pushed with --use-libraries).
Now that the iOS team wants to integrate Swift pods, they had to add the use_framework! option in the Podfile of their projects. Of course, they obtained the following error during pod install :
The 'XXX' target has transitive dependencies that include static
binaries
I spent half a day on the web looking for a way to make my pods compatible with the use_framework! option, in vain. This is very frustrating, as Google Services pods are proofs that it's possible to bypass this problem in a clean way (not with the verify_no_static_framework_transitive_dependencies trick) : the main pod and almost all its dependencies contain static libraries, and everything works perfectly along with Swift pods. Exemple with Google/SignIn which depends on Google/Core (vendored_libraries: Libraries/libGGLCore.a) and GoogleSignIn (vendored_libraries: Libraries/libSignIn.a).
Any idea of what I can do to make my pods compatible with the use_framework! option ?
Thank you all,
Cheers,
Tom
I think I found a hack for my problem. This is quite weird, but I'd say it's clean enough to use it in production ;)
I found it here. The idea is simply to include a source file (even an empty one) in your source_files list inside your podspec.
Basically, the source section of my podspec looks like this :
s.source_files = "myLib/Empty.m", "myLib/Headers/*.h"
s.vendored_libraries = "myLib/myLib.a"
The only modification I made is to add "myLib/Empty.m" in the source files (Empty.m is strictly empty). Without it, I systematically have the transitive dependencies error when I pod install. With it, pod install works fine. It worked for me with both Cocoapods 0.0.39 and 1.0.0.beta.4.
Well, looks like it's a not so dirty solution, but I'm not sure it'll work in every case. And it's no good news about the cleanliness of Cocoapods...
As I mentionned in comments earlier, Google seems to have found a cleaner solution. So if anybody have an idea of the real clean solution, please share !
Cheers,
Tom
PS : I think I'll name the file DirtyCocoapodHack.m instead of Empty.m, sure they'll love it in the dev team ;)
Is there a way to figure out if an iOS repository is using cocoapods or not?
At my first thought I was planning to use github api and check if the Podfile exists. But there could be repositories which has podfile but are not actually using it.
I am working on a ruby script in which I need to figure out if the iOS repo's is using cocoapods.
I'd say your best bet would be to do what you're saying and check if there is a Podfile. I think the bigger problem with this approach would be you'd have to check in nested directories too. If you wanted to make this way more complicated than it's worth you could use the xcodeproj gem and look around the project's linked files for the Pods.xcconfig.
Im using a couple of libraries I found on GitHub, and I was wondering is there a way to know when a third party library used in an app has been updated? For example, a bug fix.
Must we continuously visit the users repository to find out for our selfs, or does using a dependency manager like Cocoa Pods have this functionality?
Thanks in advance.
Cocoa pods allows you to manage third party library, one feature it has it is pod outdated which checks for new releases of library's and also check if a project has new commits
more info on cocoa pods, see link
example 1 (library with releases only):
say you have AFNetwoking in your project using cocoapods with the following syntax: pod "AFNetworking" if you wanted to just check for updates do pod outdated, or to update the library if there are releases you would do pod update
example 2(library with most recent commits):
there times were you want to get most recent commits regardless of if it stability. On cocoapods you can do pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git'. this gets the most recent commit on git
CocoaPods handles this. Just type pod install every once in a while. It will fetch all available updates for you... I've been using CocoaPods for a long time without problems... You can even create private pods or development pods if you need to.