Carthage and GoogleMap

别说谁变了你拦得住时间么 提交于 2019-12-13 12:06:37

问题


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?


回答1:


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.




回答2:


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!




回答3:


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!



来源:https://stackoverflow.com/questions/39072411/carthage-and-googlemap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!