GoogleMaps without CocoaPods

后端 未结 2 1896
借酒劲吻你
借酒劲吻你 2020-12-02 17:08

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?

2条回答
  •  佛祖请我去吃肉
    2020-12-02 17:49

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

提交回复
热议问题