Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GoogleMaps without CocoaPods

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?

like image 824
Sandah Aung Avatar asked Aug 03 '15 08:08

Sandah Aung


People also ask

How do I use Google maps with flutter?

To use Google Maps in your Flutter app, you need to configure an API project with the Google Maps Platform, following the Maps SDK for Android's Using API key, Maps SDK for iOS' Using API key, and Maps JavaScript API's Using API key.

Where do I get Google Map API key?

Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key.


2 Answers

Sure there is:

  • Immediate answer: https://www.gstatic.com/cpdc/0646cf0bd434ed77-GoogleMaps-1.10.1.tar.gz (Download and unzip it)

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"];
like image 150
Miguel Rojas Cortés Avatar answered Oct 23 '22 15:10

Miguel Rojas Cortés


  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+.

like image 23
Deepak Kumar Sahu Avatar answered Oct 23 '22 13:10

Deepak Kumar Sahu