升级到Xcode7后,编译项目出现大片警示⚠️,多数是使用了第三方的库,问题特征如下:
warning:
/Users/.../Library/Developer/Xcode/DerivedData/ModuleCache/HJUIXHI06SFW/CoreGraphics-1YQ59ILDR3NYI.pcm: No such file or directory while processing
/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Release-iphoneos/libcocos2d.a(someClass.o):
warning:
/Users/.../Library/Developer/Xcode/DerivedData/ModuleCache/HJUIXHI06SFW/CoreGraphics-1YQ59ILDR3NYI.pcm: No object file for requested architecture while processing
/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Products/Release-iphoneos/libcocos2d.a(someClass.o):warning: Could not resolve external type c:@S@CGPoint
2016.1更新#
Lots of warnings when building with Xcode 7 with 3rd party libraries
Build Settings
- 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
苹果员工在下方评论给出了方案
Build Settings
Enabled Modules (C and Objective-C) (CLANG_ENABLE_MODULES) = NO
我按apple staff的方案并没解决,反而报了很多clang的错误。
我自己的配置方法是通过如下解决:
Build Settings
Enabled Clang Module Debugging = NO
但是这个问题自己体验是clear后消失, 但在编译几次后又可能会出现。
旧#
我尽可能的测试了所有测试方法,solution1和2是可以解决的,但是还是根据自己的需求来吧。
Solution 1##
Under the Project Target > Build Settings
change the “Debug Information Format” from “DWARF with dSYM File” to “DWARF”.
主要是忽略了用于debug的dSYM文件。
不推荐给使用了依赖dSYM文件进行错误追踪的开发者,比如集成了友盟sdk之类的。
Solution 2##
Deployment Postprocessing = Yes
(DEPLOYMENT_POSTPROCESSING=YES)
Generate Debug Symbols = No
(GCC_GENERATE_DEBUGGING_SYMBOLS=NO)
Symbols Hidden by Default = Yes
(GCC_SYMBOLS_PRIVATE_EXTERN=YES)
这种解决方法是直接不生成debug的警示⚠️
Solution 3##
To delete the derived data, Alt-Click on "Go" in the Finder top bar. Then select "Library", navigate to Developer/Xcode/DerivedData and delete the entire folder.
或者直接使用以下命令清除
sudo rm -rf ~/Library/Developer/Xcode/DerivedData/
清理缓存,不一定凑效
Solution 4##
来自stack over flow的网友Elise van Looij的解决方法
I don't have a good answer to this question: I've considered removing the question, but it is a real problem and there are only one or two other mentions of it on the internet, with no solutions either. So, if you're struggling with this: I feel your pain but unfortunately the only way I've found to deal with it is to start a new project and import all classes and other resources. But please feel free to contribute and if you come up with something better than starting over, I'll be happy to award you the green V and upvote and all that.
以上三种办法不能满足你的需求可以尝试...
如果你有好的解决方案,在下面👇回复分享给大家吧!