Xcode 链接器命令失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31592670/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:32:22  来源:igfitidea点击:

Xcode linker command failed with exit code 1

xcodeswiftsprite-kit

提问by Claudio D'Agostino

I'm having an annoying problem with Xcode. I can't run the projects and it gives me back the same error every time:

我有一个烦人的 Xcode 问题。我无法运行这些项目,它每次都会给我同样的错误:

ld: file not found: /Users/DagDigg/Library/Developer/Xcode/DerivedData/Roundy2-dtzcccrlvjvoxsapfbdzchhtuivr/Build/Intermediates/Roundy2.build/Debug-iphoneos/Roundy2.build/Objects-normal/arm64/AppDelegate.o

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld:找不到文件:/Users/DagDigg/Library/Developer/Xcode/DerivedData/Roundy2-dtzcccrlvjvoxsapfbdzchhtuivr/Build/Intermediates/Roundy2.build/Debug-iphoneos/Roundy2.build/Objects-normal/arm64/AppDelegate.o

clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

I'm unable to run every project. Even if I create an empty one...

我无法运行每个项目。即使我创建了一个空的...

I'm using Xcode 7 beta 3 and an iPhone with iOS 9 beta 4.

我使用的是 Xcode 7 beta 3 和装有 iOS 9 beta 4 的 iPhone。

回答by Fred Faust

Sometimes it's helpful to quit Xcode and erase the files in your DeriveData folder at

有时退出 Xcode 并删除 DeriveData 文件夹中的文件会很有帮助

~/Library/Developer/Xcode/DerivedData

回答by claassenApps

I've also fixed this issue by going to Product -> Clean in XCode. This might erase the files in the files in the Derived Data folder in the process.

我还通过转到 XCode 中的 Product -> Clean 解决了这个问题。这可能会在此过程中删除派生数据文件夹中文件中的文件。

回答by HornBell

Clean build folder + Rebuild the project worked for me.

清理构建文件夹+重建对我有用的项目。

Step 1: product -> Clean Build Folder

第 1 步:产品 -> 清理构建文件夹

Step 2: product -> Build

第 2 步:产品 -> 构建

回答by Mohammad Reza Koohkan

Usualy this issue occur while you run your project on simulator devices , and simply you can remove DerivedData folder to pass this

通常在模拟器设备上运行项目时会出现此问题,只需删除 DerivedData 文件夹即可传递此问题

But i suggest you to use real devices

但我建议你使用真实设备

回答by AG Liber

Maybe double-check the Xcodefile you are running. Close the Xcodeproject then be sure to open the <projectname>.xcworkspacefile.

也许仔细检查Xcode您正在运行的文件。关闭Xcode项目然后确保打开<projectname>.xcworkspace文件。

If you are using cocoapods, the error can be from trying to build from the .xcodeprojfile instead of the .xcworkspacefile generated by the pod install.

如果您使用的是cocoapods,则错误可能是由于尝试从该.xcodeproj文件而不是.xcworkspace由 pod 安装生成的文件进行构建。



"Open the MyApp.xcworkspacethat was created. This should be the file you use everyday to create your app." - guides.cocoapods.org/using/using-cocoapods

“打开MyApp.xcworkspace创建的文件。这应该是你每天用来创建应用程序的文件。” - guides.cocoapods.org/using/using-cocoapods