在 iOS 中找不到 GoogleMaps sdk 框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19130629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 01:57:09  来源:igfitidea点击:

Framework not found GoogleMaps sdk in iOS

iphoneiosxcode4.5google-maps-sdk-ios

提问by IKKA

I want to use google map to existing(not a new one) iPhone project.Now i am using Google map ios sdkand i successfully added google map framework to my project.But i got error like this

我想将谷歌地图用于现有(不是新的)iPhone 项目。现在我正在使用谷歌地图 ios sdk并且我成功地将谷歌地图框架添加到我的项目中。但是我遇到了这样的错误

ld: framework not found GoogleMaps
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How to solve this issue.I am using xcode4.5 and google map iOS sdk version is 1.5. When i am creating new project with google map iOS sdk then no error getting for me.Error only for existing iOS Project.Please help me.

如何解决这个问题。我使用的是 xcode4.5,谷歌地图 iOS sdk 版本是 1.5。当我使用谷歌地图 iOS sdk 创建新项目时,我不会出错。错误仅适用于现有的 iOS 项目。请帮助我。

回答by IKKA

I solved my issue

我解决了我的问题

You need to do this

你需要这样做

  1. Click on your project (targets)
  2. Click on Build Settings
  3. Under Framework search paths(set your framework path)
  1. 单击您的项目(目标
  2. 点击构建设置
  3. 框架搜索路径下(设置您的框架路径)

Following information for getting framework search paths

以下信息用于获取框架搜索路径

  1. Right click on your framework folder (for ex: GoogleMaps.framework)
  2. select Get info
  3. copy the path from General->whereand paste this path in your framework search path (path should contain in single line)
  1. 右键单击您的框架文件夹(例如:GoogleMaps.framework)
  2. 选择获取信息
  3. General->where复制路径并将此路径粘贴到您的框架搜索路径中(路径应包含在单行中)

Good luck

祝你好运

回答by Stefan Ciprian Hotoleanu

I encountered a scenario in which I had to import a project that was using Google Maps and noticed the same problem - module: "Google Maps" not found. To solve this problem it was necessary to delete Podfile.lock and Podfile folder and re-install the pods again. Good luck !

我遇到了一个场景,我必须导入一个使用谷歌地图的项目,并注意到同样的问题 - 模块:找不到“谷歌地图”。为了解决这个问题,需要删除 Podfile.lock 和 Podfile 文件夹并重新安装 Pod。祝你好运 !

回答by WaleedAmmari

You can also : - remove GoogleMaps from Podfile - pod install - add GoogleMaps to your Podfile again - pod install

您还可以: - 从 Podfile 中删除 GoogleMaps - pod install - 再次将 GoogleMaps 添加到您的 Podfile - pod install

This solution works for me, you can also check the search paths a well.

这个解决方案对我有用,你也可以很好地检查搜索路径。

回答by AdamG

Clean your project. The shortcut is command + shift + k. This will clear information that xcode has stored that might imply that the sdk isn't included.

清理你的项目。快捷键是 command + shift + k。这将清除 xcode 存储的可能暗示不包含 sdk 的信息。

Also press the project icon at the top of the hierarchy of files, press the target that is your project, press build phases, open link with binary libraries, and make sure that the google maps sdk is in there. If it is not, press + and add it in.

同时按文件层次结构顶部的项目图标,按你的项目的目标,按构建阶段,打开二进制库链接,并确保谷歌地图sdk在那里。如果不是,请按 + 并添加它。

回答by Maulik

Follow the steps :

按照步骤 :

  • Download GoogleMaps-iOS-1.1.0.zipfrom their site
  • Unzip the file. You now have a GoogleMaps-iOS-1.1.0folder
  • In that folder you have a GoogleMaps.frameworkfolder.
  • Copy or move the GoogleMaps.frameworkfolder to inside your project folder (in Finder).
  • Drag the GoogleMaps.frameworkfolder onto your Frameworksgroup in Xcode.
  • In the options sheet, uncheck "Copy items into destination group's folder". Make sure your target is checked in "Add to targets". Click OK.
  • (Note that you can also do this the other way, by not copying it into your project folder and checking "Copy items into destination group's folder". Xcode will copy the folder itself.)

  • Import using #import "GoogleMaps/GoogleMaps.h". The angle bracket usually work too, but in this case it should use quotes.

  • GoogleMaps-iOS-1.1.0.zip从他们的网站下载
  • 解压缩文件。你现在有一个GoogleMaps-iOS-1.1.0文件夹
  • 在该文件夹中,您有一个GoogleMaps.framework文件夹。
  • GoogleMaps.framework文件夹复制或移动到项目文件夹内(在 Finder 中)。
  • GoogleMaps.framework文件夹拖到FrameworksXcode 中的组中。
  • 在选项表中,取消选中“将项目复制到目标组的文件夹”。确保您的目标在“添加到目标”中被选中。单击确定。
  • (请注意,您也可以通过其他方式执行此操作,即不要将其复制到您的项目文件夹中并选中“将项目复制到目标组的文件夹中”。Xcode 将复制文件夹本身。)

  • 使用#import "GoogleMaps/GoogleMaps.h". 尖括号通常也可以使用,但在这种情况下它应该使用引号。

From : <GoogleMaps/GoogleMaps.h> file not found Google Maps SDK for iOS

来自:<GoogleMaps/GoogleMaps.h> 文件未找到适用于 iOS 的 Google Maps SDK

回答by sebastian gamboa

my problem was fixed by adding in:

我的问题是通过添加解决的:

build settings

Framework Search Paths

build settings

Framework Search Paths

clickable and add the following lines:

可点击并添加以下几行:

"${PODS_ROOT}/GoogleMaps/Base/Frameworks"

"${PODS_ROOT}/GoogleMaps/Maps/Frameworks"

“${PODS_ROOT}/GoogleMaps/Base/Frameworks”

“${PODS_ROOT}/GoogleMaps/Maps/Frameworks”

回答by Petro Gordiyevich

Maybe it'll be useful for anybody, next steps helped me: 1. Delete "Headers" and "GoogleMaps" folders manually (from the Finder). 2. Run 'pod install' 3. Re-build the project in Xcode.

也许它对任何人都有用,接下来的步骤对我有帮助: 1. 手动删除“Headers”和“GoogleMaps”文件夹(从 Finder)。2. 运行“pod install” 3. 在 Xcode 中重新构建项目。

回答by Sourabh Shekhar

Delete derived data and delete Podfile.lock file and then run pod install.

删除派生数据并删除 Podfile.lock 文件,然后运行 ​​pod install。

回答by Soheil Jadidian

I've been struggling with this issue for hours; I'm using CocoaPods, Swift and Xcode 6.1.1. I followed all the steps for including GoogleMaps in my project carefully, tried many different things like removing symbolic links in the downloaded package or manually linking the binaries in build phases or trying #include "GoogleMaps.h", #include "GoogleMaps/GoogleMaps.h"and "#include <GoogleMaps/GoogleMaps.h>in my bridge file, none of that worked... Finally used CocoaPods instead of including the framework myself and it worked! Hope it helps someone out there:

我已经为这个问题苦苦挣扎了几个小时;我正在使用 CocoaPods、Swift 和 Xcode 6.1.1。我跟所有的步骤仔细,包括在我的项目的GoogleMaps,试图在下载的软件包中除去符号链接或手动连接的二进制文件构建阶段或尝试许多不同的东西#include "GoogleMaps.h"#include "GoogleMaps/GoogleMaps.h""#include <GoogleMaps/GoogleMaps.h>在我的桥文件,没有奏效......最后使用 CocoaPods 而不是我自己包含框架并且它起作用了!希望它可以帮助那里的人:

In the Podfile:

在 Podfile 中:

pod 'Google-Maps-iOS-SDK', '~> 1.9.2'

pod 'Google-Maps-iOS-SDK', '~> 1.9.2'

And in your Bridge file:

在您的 Bridge 文件中:

#import "GoogleMaps.h"

#import "GoogleMaps.h"

回答by Rowan Gontier

In my case, I forgot that I need to open the workspace file with pods, not the project.

就我而言,我忘记了我需要使用 pod 打开工作区文件,而不是项目。