Adding Google Analytics to your CocoaPod
You can add other Pods to your Pod as a dependency defined in your
Pod::Spec.new do |s| s.dependency = 'PodName' end
Then all you need to do is run
Adding Google Analytics
But if you try to add
'Google/Analytics'as dependency, you are out of luck. ( At least I was, as I could not find any other way to add it. )
It’s great that Google is using Cocoapods to distribute their SDK, but it is still the same crappy Obj-C Static library.
So, to avoid conflicts with frameworks and static libraries I decided to download Analytics SDK and add all files (
.alibraries) to my Pod in path:
Then I updated my
Pod::Spec.new do |s| s.source_files = 'Pod/Classes/**/*' s.libraries = 'sqlite3', 'c++', 'icucore', 'z' s.frameworks = 'CoreData', 'Foundation', 'SystemConfiguration' s.vendored_libraries = 'Pod/Classes/Libraries/Analytics/libGoogleAnalyticsServices.a', 'Pod/Classes/Libraries/Analytics/libAdIdAccess.a' end
pod lib lintis finally not throwing any warning or errors at me.
comments powered by Disqus