Google Maps Utilities IOS Pod错误 [英] Google Maps Utilities IOS Pod error

查看:86
本文介绍了Google Maps Utilities IOS Pod错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将Google Maps IOS实用程序(用于标记群集)添加到带有Pod的快速xcode项目中. 当我运行pod install时,它将失败,并显示以下错误:

I'm having trouble adding Google Maps IOS Utilities (for marker clustering) to my swift xcode project with pods. When I run pod install it fails with the following error:

"Pods-App"目标具有传递性依赖关系,其中包括静态 二进制文件: (/Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework, /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMapsCore.framework, 和 /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMaps.framework)

The 'Pods-App' target has transitive dependencies that include static binaries: (/Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Base/Frameworks/GoogleMapsBase.framework, /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMapsCore.framework, and /Users/warrick/Projects/orix/App/Pods/GoogleMaps/Subspecs/Maps/Frameworks/GoogleMaps.framework)

Google地图可以正常工作,但是一旦添加实用程序,它就会中断.

Google maps works fine, but as soon as I add the utilities it breaks.

此错误消息是什么意思,我该如何解决呢?

What does this error message mean, and how can I go about resolving it?

这是我的Podfile:

Here is my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
workspace '../app'

target 'App' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'

  # Firebase - used for notifications
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

推荐答案

由于Cocoapods的限制,这是一个没有现成的解决方案的问题.当在Swift中构建应用程序时,会出现限制,您会在Podfile中包含use_frameworks!,并使用作为静态库(例如Google Maps)提供的可传递依赖项.

This is an issue that doesn’t have an out of the box solution due to Cocoapods limitations. The limitation occurs when an application is built in Swift, you are including use_frameworks! in your podfile, and are using a transitive dependency that is provided as a static library (such as Google Maps).

如果Google将不提供动态框架(直到它支持iOS 7),当前的解决方法是将Google Maps IOS Utilities手动集成到您的项目中.

Becase Google will not provide a dynamic framework (until it supports iOS 7), the current workaround is to integrate Google Maps IOS Utilities manually into your project.

此处介绍了集成步骤: https: //github.com/googlemaps/google-maps-ios-utils/blob/b721e95a500d0c9a4fd93738e83fc86c2a57ac89/Swift.md

The integration steps are described here: https://github.com/googlemaps/google-maps-ios-utils/blob/b721e95a500d0c9a4fd93738e83fc86c2a57ac89/Swift.md

  • 从Podfile中删除Google-Maps-iOS-Utils(如果有). 在您的项目中,创建一个名为'Google-Maps-iOS-Utils'的组.
  • Remove Google-Maps-iOS-Utils from the Podfile (if it is there). In your project create a group named 'Google-Maps-iOS-Utils'.

  • 将存储库下载到本地计算机中.
  • 通过右键单击'Google-Maps-iOS-Utils'组并选择将文件添加到...",将src目录内的文件夹添加到您的项目中. (请确保选择目标作为应用目标,以避免出现未定义的符号问题.)
  • 确保使用标题映射"在XCode设置中为您的应用目标启用(默认情况下在XCode中启用).
  • 使用#import "GMUMarkerClustering.h"添加桥接头文件(请注意相对路径).
  • 打开伞形标题GMUMarkerClustering.h(在Google-Maps-iOS-Utils/Cluster组下),然后将所有导入路径更改为relative.例如,将#import <Google-Maps-iOS-Utils/GMUCluster.h>更改为#import "GMUCluster.h". (使用标题映射"设置将正确解析相对路径.)
  • 构建您的项目.
  • 就是这样.
    • Download the repo into your local computer.
    • Add the folders inside the src directory into your project by right clicking on the 'Google-Maps-iOS-Utils' group and selecting "Add Files to ..." (Make sure you select the target as your app target to avoid undefined symbols issue).
    • Make sure "Use Header Map" is ON for your app target in XCode Settings (it is ON by default in XCode).
    • Add a bridging header file with #import "GMUMarkerClustering.h" (note the relative path).
    • Open the umbrella header GMUMarkerClustering.h (under the Google-Maps-iOS-Utils/Cluster group) and change all the import paths to relative. For example, change #import <Google-Maps-iOS-Utils/GMUCluster.h> to #import "GMUCluster.h". (The 'Use Header Map' setting will resolve the relative path correctly).
    • Build your project.
    • That's it.
    • 这篇关于Google Maps Utilities IOS Pod错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆