xCode 7 错误:在 Google 地图框架模块中包含非模块化标头
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33292679/
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
xCode 7 error: include of non-modular header inside framework module with Google Maps
提问by goelv
I updated to xCode 7.1 today and tried to build my app but I'm getting this error:
我今天更新到 xCode 7.1 并尝试构建我的应用程序,但出现此错误:
I have already tried going to Build Settings under "Target" and set "Allow Non-modular Includes in Framework Modules" to YES but that didn't solve this issue.
我已经尝试转到“目标”下的“构建设置”并将“允许框架模块中的非模块化包含”设置为“是”,但这并没有解决这个问题。
UPDATE: Since this was preventing me from compiling and hindering my progress in terms of development, I recommend you download an older version of xCode from Apple (https://developer.apple.com/downloads/make sure to login). You can download version 7.0.1 from the link and at least continue development.
更新:由于这阻止了我编译并阻碍了我的开发进度,我建议您从 Apple 下载旧版本的 xCode(https://developer.apple.com/downloads/确保登录)。您可以从链接下载 7.0.1 版并至少继续开发。
This is what I've done and I can continue development.
这就是我所做的,我可以继续开发。
I know this is not a fix, but its workaround for the people who wish to continue development.
我知道这不是修复,而是希望继续开发的人的解决方法。
采纳答案by ak2g
Google has updated its SDK to 1.10.5, Just Reinstall Pod and it should work fine. I was facing same issue and now all issues are fixed after pod reinstallation.
Google 已将其 SDK 更新到 1.10.5,只需重新安装 Pod,它应该可以正常工作。我遇到了同样的问题,现在所有问题都在 pod 重新安装后得到解决。
回答by mpatzer
I ended up having to create an Objective-C bridging header file and adding #import <GoogleMaps/GoogleMaps.h>
whereas I hadn't needed one previously since I was using Cocoapods in a Swift project and the use_frameworks!
setting had previously taken care of this.
我最终不得不创建一个 Objective-C 桥接头文件并添加,#import <GoogleMaps/GoogleMaps.h>
而我以前不需要一个,因为我在 Swift 项目中使用 Cocoapods 并且之前的use_frameworks!
设置已经解决了这个问题。
Here's instructions for how to create the Objective-C bridging header file: (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html)
以下是有关如何创建 Objective-C 桥接头文件的说明:(https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html)
回答by Fedor Patutinskiy
https://forums.developer.apple.com/thread/23554
https://forums.developer.apple.com/thread/23554
Just remove the header search paths in build settings. In new Xcode versions (after 7.0 I guess) you need to look for the headers by linking frameworks and not by linking header files directly.
只需删除构建设置中的标题搜索路径。在新的 Xcode 版本中(我猜是 7.0 之后),您需要通过链接框架而不是直接链接头文件来查找头文件。
回答by Tr0yJ
For me, this issue was resolved by:
对我来说,这个问题是通过以下方式解决的:
- Product > Clean (cmd k)
- Product > Clean Build Folder (cmd opt k)
- Product > Run (cmd r)
- 产品 > 清洁 (cmd k)
- 产品 > 清理构建文件夹(cmd opt k)
- 产品 > 运行 (cmd r)
回答by jguffey
This threadmay be useful.
这个线程可能有用。
I tried a few things, but I'm not positive which one fixed the issues. First, I edited my Podfile to include:
我尝试了几件事,但我不确定哪一个解决了问题。首先,我编辑了我的 Podfile 以包括:
post_install do |installer|
installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
end
end
Then, I added a bridging header file, with one line:
然后,我添加了一个桥接头文件,其中一行:
#import <GoogleMaps/GoogleMaps.h>
Cleaned and rebuilt the project and that did the trick.
清理并重建项目,就成功了。