一个空的Cocoatouch Framework在Xcode上出错了吗?

时间:2019-02-06 03:37:18

标签: ios swift xcode cocoa-touch

我创建了一个cocoatcouch框架,将空白的swift文件添加到项目后,我会收到错误消息:

  

发生内部错误。源代码编辑器功能受到限制。尝试还原。

项目语言设置为快速

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/Darwin.h"
        ^
/Users/aryan.ghassemi/Desktop/Darwin/Darwin/Darwin.h:9:9: error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
        ^
<unknown>:0: error: could not build Objective-C module 'Darwin'
0  swift                    0x0000000104cf959a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x0000000104cf8d4e SignalHandler(int) + 302
2  libsystem_platform.dylib 0x00007fff7966eb3d _sigtramp + 29
3  libsystem_platform.dylib 0x00007fd4e542118f _sigtramp + 1809524335
4  swift                    0x000000010223504b swift::SerializedModuleLoader::loadModule(swift::SourceLoc, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >) + 891
5  swift                    0x000000010237dbb3 swift::ASTContext::getModule(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >) + 227
6  swift                    0x000000010205bf7c swift::performNameBinding(swift::SourceFile&, unsigned int) + 2028
7  swift                    0x0000000101d938e3 swift::CompilerInstance::performSema() + 3379
8  swift                    0x0000000100f7f50b performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 731
9  swift                    0x0000000100f7bd35 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717
10 swift                    0x0000000100f21965 main + 1349
11 libdyld.dylib            0x00007fff79483ed9 start + 1
12 libdyld.dylib            0x000000000000004c start + 2260189556
Stack dump:

1 个答案:

答案 0 :(得分:0)

出现此问题的主要原因是多个XCode。

安装命令行工具,然后尝试在下图中设置相同的工具版本。

enter image description here