xCode 7.1:无法构建 Objective-C 模块“GoogleMaps”

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

xCode 7.1: Could not build Objective-C module 'GoogleMaps'

objective-cxcodeswift

提问by Kev

I am using the GoogleMaps iOS SDK in my app and added it with cocoapods. However, after updating xCode from 7.0 to 7.1 I'm suddenly getting the following error: Could not build Objective-C module 'GoogleMaps'

我在我的应用程序中使用了 GoogleMaps iOS SDK,并用 cocoapods 添加了它。但是,在将 xCode 从 7.0 更新到 7.1 后,我突然收到以下错误:无法构建 Objective-C 模块“GoogleMaps”

In addition xCode also gives me an error in the GoogleMaps.h file in the GoogleMaps.framework: Include of non-modular header inside framework module 'GoogleMaps'

此外,xCode 还在 GoogleMaps.framework 的 GoogleMaps.h 文件中给了我一个错误: Include of non-modular header inside framework module 'GoogleMaps'

I already deleted my DerivedData folder, updated cocoapods, reinstalled the GoogleMaps iOS SDK and cleaned and build the framework's scheme and my app's scheme. But nothing helped so far.

我已经删除了我的 DerivedData 文件夹,更新了 cocoapods,重新安装了 GoogleMaps iOS SDK 并清理和构建了框架的方案和我的应用程序的方案。但到目前为止没有任何帮助。

采纳答案by mpatzer

Answered in this similar question: xCode 7 error: include of non-modular header inside framework module with Google Maps

在这个类似的问题中回答:xCode 7 error: include of non-modular header inside framework module with Google Maps

...but essentially you'll need to create an Objective-C bridging header file whereas you may not have needed one with Xcode 7.0. The why still eludes me.

...但本质上,您需要创建一个 Objective-C 桥接头文件,而在 Xcode 7.0 中您可能不需要。为什么我仍然不明白。

回答by Marwa Lamey

you should open the .xcworkspace not .xcodeproj once you added cocoa pods your project folder will contain the .xcworkspace file

添加可可豆荚后,您应该打开 .xcworkspace 而不是 .xcodeproj,您的项目文件夹将包含 .xcworkspace 文件