xcode 找不到这样的模块“GoogleMaps”,但已安装

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37633766/
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-09-15 08:51:49  来源:igfitidea点击:

No such module 'GoogleMaps' found however it is installed

iosxcodeswiftcocoapodsgoogle-maps-sdk-ios

提问by maz

I have installed the 'GoogleMaps' pod using cocoa pods and the project was building correctly, however when I transferred my project to another device through iCloud (the projects directory is in iCloud) the GoogleMaps pod stopped working. I attempted to simply run pod install again however this mad no difference, the pod is clearly there and the pod install was successful. I am beyond confused.

我已经使用可可豆荚安装了“GoogleMaps”豆荚并且项目构建正确,但是当我通过 iCloud 将我的项目转移到另一台设备(项目目录在 iCloud 中)时,GoogleMaps 豆荚停止工作。我试图再次简单地运行 pod install 但是这没有什么区别,pod 显然在那里并且 pod install 成功。我非常困惑。

enter image description here

在此处输入图片说明

采纳答案by Axel

First off try to clean the project by

首先尝试通过以下方式清理项目

Command + Shift + Options + K

Command + Shift + 选项 + K

If I'm not mistaken, GoogleMaps framework is built from Objective-C so if there's still a problem then do the following steps:

如果我没记错的话,GoogleMaps 框架是从 Objective-C 构建的,所以如果仍然存在问题,请执行以下步骤:

  1. Create a bridging header file which you can trigger and setup automatically by creating a dummy Objective-C class in your Swift project. Xcode will then ask you if you would want to create a bridging header, click yes. Delete the dummy class you created after.
  2. Configure the header search path to point the Pods with recursion enter image description here

  3. Do a clean-build.

  1. 创建一个桥接头文件,您可以通过在 Swift 项目中创建一个虚拟的 Objective-C 类来自动触发和设置。然后 Xcode 会询问您是否要创建桥接头,单击是。删除您之后创建的虚拟类。
  2. 配置头搜索路径以递归指向 Pod 在此处输入图片说明

  3. 做一个干净的构建。

回答by Cody Moorhouse

For me to fix mine, I had to update my GoogleMaps pod.

为了修复我的问题,我必须更新我的 GoogleMaps pod。

  1. To check: pod outdated
  2. To update: pod update GoogleMaps
  3. To clean cache: pod cache clean --all(or you can specify GoogleMaps)
  4. To install: pod install
  1. 去检查: pod outdated
  2. 更新: pod update GoogleMaps
  3. 清理缓存:(pod cache clean --all或者您可以指定 GoogleMaps)
  4. 安装: pod install

回答by Dler

This worked for me:

这对我有用:

  1. Close the Xcode.
  2. Remove all pods from project (pod deintegrate)
  3. Clean Pods cache (pod cache clean --all)
  4. Install all pods again (pod install)
  1. 关闭 Xcode。
  2. 从项目 ( pod deintegrate) 中删除所有 Pod
  3. 清理 Pod 缓存 ( pod cache clean --all)
  4. 再次安装所有 Pod ( pod install)

回答by Ricardo Delgado

It works for me:

这个对我有用:

  1. Delete folder Pods in your project folder.

  2. Delete file podfile.look and pods.xcodeproject (not delete podfile)

  3. Close X-Code and install pods in your terminal (pod install)

  4. Open X-Code, clean the project and run.

  1. 删除项目文件夹中的文件夹 Pods。

  2. 删除文件 podfile.look 和 pods.xcodeproject(不删除 podfile)

  3. 关闭 X-Code 并在您的终端中安装 pods ( pod install)

  4. 打开 X-Code,清理项目并运行。

回答by Abla Ibraheem

try to comment pod GoogleMapsand another google pod on your podfile then run pod instal from terminal this will remove your pod install from your project, back to you project on pod file remove your commented pods and run pod installfrom terminal one more time, go to your xcode project clean and run this will be work with you.

尝试GoogleMaps在您的 podfile 上评论 pod和另一个 google pod,然后从终端运行 pod instal 这将从您的项目中删除您的 pod install,返回到您在 pod 文件上的项目删除您评论的 pod 并pod install再次从终端运行,转到您的 xcode项目清理并运行这将与您合作。