xcode iOS:如何修复以下警告问题?

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

iOS: How to fix the following warning issues?

iosxcode

提问by tipsywacky

Ever since updating to xcode 7. I received a lot of warnings that I am not familiar with and have no idea what they are.

自从更新到 xcode 7。我收到了很多我不熟悉的警告,也不知道它们是什么。

warning: /Users/minidragon/Library/Developer/Xcode/DerivedData/ModuleCache/HJUIXHI06SFW/CoreGraphics-1YQ59ILDR3NYI.pcm: No such file or directory
while processing /Users/tipsy/Library/Developer/Xcode/DerivedData/rainbowtail-ceybamfcswlsqubjdieleicoaimx/Build/Products/Release-iphoneos/libcocos2d.a(cpRatchetJoint.o):
warning: /Users/tipsy/Library/Developer/Xcode/DerivedData/ModuleCache/HJUIXHI06SFW/CoreGraphics-1YQ59ILDR3NYI.pcm: No object file for requested architecture
while processing /Users/tipsy/Library/Developer/Xcode/DerivedData/rainbowtail-ceybamfcswlsqubjdieleicoaimx/Build/Products/Release-iphoneos/libcocos2d.a(cpRatchetJoint.o):
warning: Could not resolve external type c:@S@CGPoint

Does anyone know what they are and how to fix them? Thanks in advance.

有谁知道它们是什么以及如何修复它们?提前致谢。

回答by

May be below solutions works for you.

可能以下解决方案适合您。

Solution 1

方案一

Under the Project Target > Build Settings, change the “Debug Information Format” from “DWARF with dSYM File” to “DWARF”.

在 Project Target > Build Settings 下,将“ Debug Information Format”从“ DWARF with dSYM File”更改为“ DWARF”。

Solution 2

解决方案2

Deployment Postprocessing = Yes (DEPLOYMENT_POSTPROCESSING=YES)

部署后处理 = 是 ( DEPLOYMENT_POSTPROCESSING=YES)

Generate Debug Symbols = No (GCC_GENERATE_DEBUGGING_SYMBOLS=NO)

生成调试符号 = 否 ( GCC_GENERATE_DEBUGGING_SYMBOLS=NO)

Symbols Hidden by Default = Yes (GCC_SYMBOLS_PRIVATE_EXTERN=YES)

默认隐藏的符号 = 是 ( GCC_SYMBOLS_PRIVATE_EXTERN=YES)

See the relevant thread on Apple Developer Forums: https://forums.developer.apple.com/thread/17921

请参阅 Apple 开发者论坛上的相关主题:https: //forums.developer.apple.com/thread/17921

回答by imperiumsage

If you use pods, add this to the Podfile after all the pod dependencies

如果你使用 pods,在所有 pod 依赖项之后添加这个到 Podfile

post_install do |installer_representation|
    installer_representation.pods_project.build_configurations.each do |config|
        config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'
    end
end

This will ensure that the build settings for the pod target anytime you install/update will have the right setting.

这将确保在您安装/更新时 pod 目标的构建设置将具有正确的设置。

Then open the Pod target's build settings and for each third party pod set
Enable Modules (C and Objective-C)to NO.

然后打开 Pod 目标的构建设置,并将每个第三方 Pod 设置
Enable Modules (C and Objective-C)NO.

Clean and build, the warnings should go away.

清理并构建,警告应该消失。

The solution suggested above by Bhumicaonly silences the warnings and will prevent you from getting useful information from crash reports.

Bhumica上面建议的解决方案只会使警告静音,并且会阻止您从崩溃报告中获取有用的信息。

PS: https://forums.developer.apple.com/thread/17921suggests to do all 3 of the following, but I had to do only the CLANG_ENABLE_MODULES, YMMV

PS:https: //forums.developer.apple.com/thread/17921建议执行以下所有 3 项,但我只需要执行CLANG_ENABLE_MODULES,YMMV

  • Precompile Prefix (GCC_PRECOMPILE_PREFIX_HEADER) = NO
  • Debug Information Format (DEBUG_INFORMATION_FORMAT) = DWARF with dSYM
  • Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO
  • Precompile Prefix (GCC_PRECOMPILE_PREFIX_HEADER) = NO
  • Debug Information Format (DEBUG_INFORMATION_FORMAT) = DWARF with dSYM
  • Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO