gpt4 book ai didi

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

转载 作者:技术小花猫 更新时间:2023-10-29 11:16:08 24 4
gpt4 key购买 nike

我刚刚将我的 Xcode 更新到 7.2 版。现在我尝试构建一个 framework从命令行使用 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'

在 XCode 7.1 中一切正常。所以 XCode 7.2 中一定有一些改变。有人知道吗?

编辑:

这是我的构建命令

这行得通

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\
-方案ABC -配置调试\
-sdk iphonesimulator\
-destination 'platform=iOS Simulator,name=iPhone 6'

关于ios - xcode 7.2 无法构建 Objective-C 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34180163/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com