xcode 7.2无法构buildObjective-C模块
我刚刚更新我的Xcode到版本7.2。 现在我尝试使用xcodebuild从命令行构build一个框架 ,但有这个错误
.... /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'
在XCode 7.1中一切运行良好。 所以在XCode 7.2中必须有所改变。 任何人都有线索?
编辑:
这是我的build造指挥官
这工作
xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphoneos
这不起作用:
xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphonesimulator
一种可能的解决方法是通过添加以下内容来提供目的地:
-destination 'platform=iOS Simulator,name=iPhone 6'
在你的情况下,这是这样的:
xcodebuild clean build -workspace XYZ.xcworkspace \ -scheme ABC -configuration Debug \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6'
尝试指定目标,即xcodebuild -workspace 'App.xcworkspace' -scheme 'App Scheme' -destination 'id=[THE_SIMULATOR_ID_YOU_WISH_TO_USE]' -sdk iphonesimulator9.2 -configuration Debug
参考: https : //twitter.com/nlutsenko/status/674863890342109185
另外可以使用https://github.com/facebook/xctool ,其工作方式类似于xcodebuild
../<path>/xctool/xctool.sh clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphonesimulator
我向苹果公司报告了同样的问题,当从命令行使用“scheme”构build并指定-sdk为模拟器时,实际发生在任何types的项目上。
即使我们指定了-sdk iphonesimulator
我看起来也像ARCH
和PLATFORM_NAME
variables设置不正确。 我目前的工作是在我的xcodebuild
命令行的-sdk iphonesimulator
标志之上指定PLATFORM_NAME=iphonesimulator
。
等待从苹果的错误报告中听到更多。