Xcode 9.4.1 Could not build module and redefinition of module - Can't Build

对着背影说爱祢 提交于 2019-12-24 09:24:28

问题


Encountering this issue in Xcode, solutions I've tried:

  • Enabled modules to YES and NO
  • Reinstalled Xcode 9.4.1 by deleting 9.4.1 and ~/Library/Developer
  • Downgraded command lines tools to 9.4.1
  • Downgraded Cocoapods to 1.4.0 from 1.5.3

I'm at a loss at this point can someone point me to the right direction here? I've already spent an entire day on this. Other projects build fine though.


回答1:


I SOLVED IT!

XCode was adding the following Header Search Paths:

/usr/include/libxml2 recursive
/usr/include/libxml2 non-recursive

But libxml2 is already included in the SDK from XCode.app via $(inherited) search path so everything was conflicting.

Removed those two /usr/include/libxml2 paths at the top of my folder hierarchy fixed it!

Thank the XCode gods.




回答2:


I got redefinition of module when was working on own framework and added a first .m file (as a part of Cocoa Touch Class) and created module.modulemap file. Please note that this error is shown even if you do not add a path into Module Map File

To solve this issue I just renamed a module.modulemap to ModuleName.modulemap



来源:https://stackoverflow.com/questions/51255621/xcode-9-4-1-could-not-build-module-and-redefinition-of-module-cant-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!