xcode 7.2 无法构建 Objective-C 模块 [英] xcode 7.2 Could not build Objective-C module
本文介绍了xcode 7.2 无法构建 Objective-C 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚将我的 Xcode 更新到了 7.2 版.现在我尝试使用 xcodebuild 从命令行构建框架,但出现此错误
I have just updated my Xcode to version 7.2. Now I try to build a framework from command line using xcodebuild but have this error
.... /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 中有所改变.有人知道吗?
Everything worked well in XCode 7.1. so there must be something changed in XCode 7.2. Anyone has a clue?
这是我的构建命令
这有效
xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphoneos
这不起作用:
xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration Debug -sdk iphonesimulator
推荐答案
一种可能的解决方法是通过添加以下内容来提供目的地:
One possible workaround would be to supply a destination by adding the following:
-destination 'platform=iOS Simulator,name=iPhone 6'
在你的情况下是这样的:
In your case this would like this:
xcodebuild clean build -workspace XYZ.xcworkspace -scheme ABC -configuration 调试 -sdk iphone模拟器-destination 'platform=iOS Simulator,name=iPhone 6'
这篇关于xcode 7.2 无法构建 Objective-C 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文