Ios xcode 7.2无法构建Objective-C模块

Ios xcode 7.2无法构建Objective-C模块,ios,xcode,module,xcodebuild,Ios,Xcode,Module,Xcodebuild,我刚刚将Xcode更新到7.2版。现在,我尝试使用xcodebuild从命令行生成一个命令行,但是出现了这个错误 .... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:6

我刚刚将Xcode更新到7.2版。现在,我尝试使用xcodebuild从命令行生成一个命令行,但是出现了这个错误

.... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:6:
#import <QuartzCore/CABase.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:11:10: error: could not build module 'Darwin'
#include <stdbool.h>
         ^
/Users/atran/Desktop/Repos/DSA_Working_Directory/Libs/Kingfisher/Kingfisher/Kingfisher.h:27:9: note: while building module 'UIKit' imported from /Users/atran/Desktop/Repos/DSA_Working_Directory/Libs/Kingfisher/Kingfisher/Kingfisher.h:27:
#import <UIKit/UIKit.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h:11:9: note: while building module 'QuartzCore' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h:11:
#import <QuartzCore/CATransform3D.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:9: note: while building module 'OpenGLES' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h:7:
#import <OpenGLES/EAGLDrawable.h>
        ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:8:10: error: could not build module 'Foundation'
#include <Foundation/Foundation.h>
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Users/atran/Desktop/Repos/DSA_Working_Directory/Libs/Kingfisher/Kingfisher/Kingfisher.h"
        ^
/Users/atran/Desktop/Repos/DSA_Working_Directory/Libs/Kingfisher/Kingfisher/Kingfisher.h:27:9: error: could not build module 'UIKit'
#import <UIKit/UIKit.h>
        ^
<unknown>:0: error: could not build Objective-C module 'Kingfisher'
这不起作用:

xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphonesimulator

另一种选择是使用 其工作原理与xcodebuild类似

../<path>/xctool/xctool.sh clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphonesimulator
。//xctool/xctool.sh clean build-workspace XYZ.xcworkspace-scheme ABC-configuration Debug-sdk iphonesimulator

一种可能的解决方法是通过添加以下内容来提供目的地:

-destination 'platform=iOS Simulator,name=iPhone 6'
在您的情况下,这将如下所示:

xcodebuild clean build-workspace XYZ.xcworkspace\
-方案ABC-配置调试\
-sdk iPhone模拟器\

-destination'platform=iOS Simulator,name=iphone6'
尝试指定目标,即,
xcodebuild-workspace'App.xcworkspace'-scheme'App scheme'-destination'id=[您希望使用的模拟器id'-sdk iphonesimulator 9.2-配置调试


参考资料:

我向苹果公司报告了同样的问题,它实际上发生在任何类型的项目上,当使用“方案”从命令行构建并指定-sdk作为模拟器时

我看起来好像
ARCH
PLATFORM\u NAME
变量设置不正确,即使我们正在指定
-sdk iphonesimulator
。我目前的解决办法是在我的
xcodebuild
命令行上的
-sdk iphonesimulator
标志上方指定
PLATFORM\u NAME=iphonesimulator


等待从我给苹果的错误报告中听到更多信息。

尝试了“构建清理”、“删除派生数据文件夹”和“重建”?这是我尝试的第一件事,但没有成功。我也遇到了同样的问题,什么都没有。如果有人发现了什么,请分享。您使用的命令行参数是什么?我在这里看到了一个类似的问题,我相信它必须与
-sdk iphonesimulator
没有得到充分尊重有关,它似乎试图使用该sdk,但它输出到了错误的中间构建文件夹,在我的情况下,如果我同时使用
-showBuildSettings
,我可以看到它,尽管设置说它应该转到
调试iphonesimulator
,实际上,它试图将二进制文件放入
Build/Products/Debug iphoneos
文件夹。我编辑了我的问题以显示我使用的命令。我最初认为我的Xcode 7.2安装不正确。我在AppStore做了软件更新。所以,即使我们清理并重新安装Xcode7.2,也不能解决这个问题,对吗?这显然是Xcode 7.2中的一个问题。请确认。是的,更具体地说,CLI工具似乎有问题。是的!非常感谢。你能解释一下,为什么需要它吗?目标过去是由命令行工具自动选择的,现在不是了
-destination 'platform=iOS Simulator,name=iPhone 6'