26

I would like to add GoogleMaps to my iOS project but I don't want to use CocoaPods. Is there any way to achieve that?

Sandah Aung
  • 6,156
  • 15
  • 56
  • 98
  • you are not forced to use cocoapods or any version tracking system. you need to download the repo from _GitHub_ and add the files to you project manually. – holex Aug 03 '15 at 09:18
  • Since when is Cocoapods ever a requirement O.o – TheCodingArt Aug 06 '15 at 00:50
  • @holex as far as I know there is not one - for iOS at least: https://github.com/googlemaps?page=1 .. do you have a link to one if it exist? – HelloWorld Aug 07 '15 at 13:39
  • it was on the page... https://github.com/googlemaps/OpenInGoogleMaps-iOS/archive/master.zip – holex Aug 07 '15 at 14:25

2 Answers2

69

Sure there is:

How did I do it (Useful for any library you need)

  • Go to the pod you need, in this case: https://cocoapods.org/pods/GoogleMaps
  • Click on "See Podspec" link below Library on the bottom right corner
  • You are gonna be taken to the podspec.json
  • At the end of the JSON, find the key "source" and use the url provided to download the SDK.

If you need instructions on how to install it manually, you can use the waybackmachine websitea and put the corresponding url, setting an earlier date. I'll save you some time:

Adding Google Maps the old way:

  1. Launch Xcode and either open an existing project, or create a new project.
    • If you're new to iOS, create a Single View Application, and ensure that Use Automatic Reference Counting is on.
  2. Drag the GoogleMaps.framework bundle to your project. When prompted, select Copy items into destination group's folder.
  3. Right-click GoogleMaps.framework in your project, and select Show In Finder.
  4. Drag the GoogleMaps.bundle from the Resources folder to your project. When prompted, ensure Copy items into destination group's folder is not selected.
  5. Select your project from the Project Navigator, and choose your application's target.
  6. Open the Build Phases tab, and within Link Binary with Libraries, add the following frameworks:
    • AVFoundation.framework
    • CoreData.framework
    • CoreLocation.framework
    • CoreText.framework
    • GLKit.framework
    • ImageIO.framework
    • libc++.dylib
    • libicucore.dylib
    • libz.dylib
    • OpenGLES.framework
    • QuartzCore.framework
    • SystemConfiguration.framework
  7. Choose your project, rather than a specific target, and open the Build Settings tab.
    • In the Other Linker Flags section, add -ObjC. If these settings are not visible, change the filter in the Build Settings bar from Basic to All.
  8. Finally, add your API key to your AppDelegate.
    • #import <GoogleMaps/GoogleMaps.h>
    • Add the following to your application:didFinishLaunchingWithOptions: method, replacing API_KEY with your API key. [GMSServices provideAPIKey:@"API_KEY"];

#import <GoogleMaps/GoogleMaps.h>

Add the following to your application:didFinishLaunchingWithOptions: method, replacing API_KEY with your API key.

[GMSServices provideAPIKey:@"API_KEY"];
KPM
  • 10,558
  • 3
  • 45
  • 66
  • 8
    You would also need CoreBluetooth.framework and Accelerate.framework, otherwise you will get undefined symbol errors. Tested on Xcode 7 for iOS 9 – marcos1490 Sep 26 '15 at 02:38
  • 1
    I've followed this guide and got the framework installed manually - thanks for the info! I've now got an issue where I cannot get my app to compile, the error is: ld: framework not found GoogleMaps for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Any suggestions? – edcs Oct 20 '15 at 10:08
  • Thanks for this! According to latest podspec [link](https://github.com/CocoaPods/Specs/blob/master/Specs/GoogleMaps/1.10.5/GoogleMaps.podspec.json), you also need to add the CoreGraphics framework. – Ri_ Nov 18 '15 at 07:05
  • Thanks a lot for your answer! (Y) – iGatiTech Feb 29 '16 at 09:12
  • Hi, I cant find resources folder when I right-click and show in finder?? btw, I am adding it to an existing project (which uses story board).. what about the automatic reference counting? – Engineeroholic Aug 27 '16 at 10:00
  • This has to be updated with adding Accelerate framework and few others like CoreBluetooth to support recent iOS versions >= 12.0 – Naresh Reddy M Nov 14 '19 at 16:42
3
  1. https://www.gstatic.com/cpdc/aa3052925ceeea2d-GoogleMaps-1.13.2.tar.gz Copy and Open this url.

  2. Drag to your Xcode project GoogleMaps.framework.

    *select Copy items into destination group's folder

  3. Right click on GoogleMaps.framework -Show in finder

  4. Inside Resources folder GoogleMaps.bundle , Drag this to Project (*Don't select copy item).

  5. Import Several FrameWork

    • CoreBluetooth.framework
    • OpenGLES.framework
    • ImageIO.framework
    • CoreData.framework
    • CoreText.framework
    • QuartzCore.framework
    • SystemConfiguration.framework
    • GLKit.framework
    • CoreLocation.framework
    • Security.framework
    • Accelerate.framework
    • libc++abi.tbd
    • libc++.1.tbd
    • libc.tbd
    • libicucore.tbd
  6. Choose your project open the Build Settings tab. In the Other Linker Flags section add -ObjC in both .Screen shot of adding -ObjC

  7. import

    Add the following to your application:didFinishLaunchingWithOptions: method, replacing API_KEY with your API key. [GMSServices provideAPIKey:@"API_KEY"];

    (*get api key https://developers.google.com/maps/documentation/ios-sdk/places#whats_in_the_api_name_ios_places)

    Please let me know any error you have found. It works for Xcode 7+,iOS 9+.