ios Xcode 4:构建失败,没有问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5363564/
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
Xcode 4: Build Failed, No Issues
提问by Adam Davis
The app works fine in the simulator, builds and runs.
该应用程序在模拟器中运行良好,构建并运行。
When I attach my device (iPhone 3GS running iOS 4.3) and target the iPhone, the result is "Build failed" with "No issues".
当我连接我的设备(运行 iOS 4.3 的 iPhone 3GS)并以 iPhone 为目标时,结果是“构建失败”和“没有问题”。
Looking at the build results window, everything is green, has a checkmark, including the Build failed notice.
查看构建结果窗口,一切都是绿色的,有一个复选标记,包括 Build failed notice。
Expanding the transcripts show no errors.
展开成绩单显示没有错误。
I cannot exclude the possibility of a signing or provisioning error, but it gave me those errors, I ironed them out, and now it's not giving me any errors or issues, just "Build failed; No issues"
我不能排除签名或配置错误的可能性,但它给了我这些错误,我解决了它们,现在它没有给我任何错误或问题,只是“构建失败;没有问题”
- In what ways can the build fail with no issues?
- Is there a way I can watch the build output to see if I can find the reason it's failing with no issues?
- Is there build output produced beyond the issues list?
- I don't see on the build window where it attempts to load the app onto my device - is this output elsewhere?
- 构建失败的方式有哪些?
- 有没有办法可以观察构建输出,看看我是否能找到它失败的原因而没有问题?
- 是否有超出问题列表的构建输出?
- 我在构建窗口中没有看到它尝试将应用程序加载到我的设备上 - 这是其他地方的输出吗?
采纳答案by Adam Davis
On one of the local Cocoa Heads mailing lists I was encouraged to attempt a small default sample project - something I should have done in the beginning to make sure my provisioning and signing worked. It built and ran on my device without issue, so all signs point toward a problem with my code or the project.
在一个本地 Cocoa Heads 邮件列表中,我被鼓励尝试一个小的默认示例项目——我应该在一开始就做这件事,以确保我的配置和签名有效。它在我的设备上构建和运行没有问题,所以所有迹象都表明我的代码或项目存在问题。
I'll be throwing things from the existing project into the new sample project, and if it fails in a similar way I should be able to narrow the problem down to a smaller region of interest.
我会将现有项目中的东西扔到新的示例项目中,如果它以类似的方式失败,我应该能够将问题缩小到更小的感兴趣区域。
I've added the main functionality of the app into a new project, and it's running fine. The only things I did differently this time was I did not set up a universal binary (iPhone only right now) and turned off all but portrait orientation. As far as I can tell everything else is the same, though if I decide to look into it further later I will diff the project files and see what else might be different.
我已将应用程序的主要功能添加到一个新项目中,并且运行良好。这次我做的唯一不同的是我没有设置通用二进制文件(现在仅限 iPhone)并关闭了除纵向以外的所有内容。据我所知,其他一切都是相同的,但如果我决定稍后进一步研究它,我将比较项目文件,看看还有什么可能不同。
So the solution for me was to start a new project a port all the functionality from the old project into the new project.
所以我的解决方案是开始一个新项目,将旧项目的所有功能移植到新项目中。
It could be that recreating the target, as Paul suggests in another answer, would fix it as well, but with such a simple project restarting from scratch was easy for me.
正如保罗在另一个答案中所建议的那样,重新创建目标可能也会修复它,但是对于我来说,从头开始这样一个简单的项目很容易。
回答by Mercurial
I've been getting 'Build Failed' with no errors in the Issue navigator(only warnings). Report navigator, though, displayed errors correctly.
我一直在问题导航器中收到“构建失败”,没有错误(只有警告)。但是,报告导航器正确显示了错误。
回答by user674180
Are you using "Underscore" and "Space", etc. for Bundle identifier?
您是否使用“下划线”和“空格”等作为捆绑标识符?
Are you using .m instead of .h in one of your imports? #import "Photo.h"
您在其中一个导入中使用 .m 而不是 .h 吗?#import "Photo.h"
回答by Codo
The first thing I'd try is to clean everything (menu Product / Clean) and the build it again. You might have already tried it.
我要尝试的第一件事是清理所有内容(菜单 Product / Clean)并再次构建它。你可能已经尝试过了。
You'll find (and you can watch during the build) the complete build output in the Log Navigator. That's the right most icon of the small icons just below the Run and Build buttons.
您将在 Log Navigator 中找到(并且可以在构建过程中观察)完整的构建输出。这是运行和构建按钮下方小图标中最右侧的图标。
The build (and debug) log files are found in the directory /Users/you/Library/Developer/XCode/DerviedData/YourProject-abcdefg/Logs/Build (and ../Debug respectively).
构建(和调试)日志文件位于目录 /Users/you/Library/Developer/XCode/DerviedData/YourProject-abcdefg/Logs/Build(和 ../Debug 分别)。
I don't think there's any output for the installation of your app on the device.
我认为在设备上安装您的应用程序没有任何输出。
回答by damian
Is there a space in your Target's Product Name?
Target 的产品名称中是否有空格?
I know that in earlier versions of Xcode this was no problem, but it seems that they broke something in Xcode 4 so it doesn't work any more (I suspect it's something to do with the DerivedData path nonsense). You can add a space to the name of your app as it appears on the Launchpad of your iDevice by setting the CFBundleDisplayName
key in the Info.plist
to something other than ${PRODUCT_NAME}
.
我知道在 Xcode 的早期版本中这没有问题,但似乎他们破坏了 Xcode 4 中的某些内容,因此它不再起作用(我怀疑这与 DerivedData 路径废话有关)。您可以通过将 中的CFBundleDisplayName
键设置为Info.plist
除${PRODUCT_NAME}
.
回答by Cortis
I had the same problem, and like someone else suggested it had to do with the bundle identifier. I had recently changed it, as a test, and had put an asterisk in it. I fixed that, and had to clean the target, and then it worked.
我遇到了同样的问题,就像其他人建议的那样,它与包标识符有关。作为测试,我最近对其进行了更改,并在其中添加了星号。我解决了这个问题,不得不清理目标,然后它就起作用了。
回答by AbePralle
This happened to me after deleting an unused target. It seems that Xcode put a space in my remaining target's CFBundleIdentifier (com.company.etc). I had to edit Info.plist with an external text editor to remove it and then it worked fine.
删除未使用的目标后,这发生在我身上。Xcode 似乎在我剩余目标的 CFBundleIdentifier (com.company.etc) 中放置了一个空格。我不得不使用外部文本编辑器编辑 Info.plist 以将其删除,然后它工作正常。
回答by Andrew
I was just playing with adding multiple projects inside a workspace and got this problem. I have a simple library in one of the projects and I was building and I added an iOS window based target to test it. I deleted the first target I made for this to rename it. After reading this I tried removing xcuserdata from inside the .xcodeproj packageand that fixed my problem. I hope this helps someone else. Running Xcode 4.1 on OS X 10.7.1.
我只是在工作区中添加多个项目并遇到了这个问题。我在其中一个项目中有一个简单的库,我正在构建并添加了一个基于 iOS 窗口的目标来测试它。我删除了为此创建的第一个目标以重命名它。阅读本文后,我尝试从 .xcodeproj 包中删除 xcuserdata并解决了我的问题。我希望这对其他人有帮助。在 OS X 10.7.1 上运行 Xcode 4.1。
回答by Mazyod
After going though all these answers, I had the exact same issue, but something different solved it for me.
经过所有这些答案后,我遇到了完全相同的问题,但不同的东西为我解决了这个问题。
The Problem:
问题:
Build failed without issues after refactoring. (Renamed a class using Edit -> Refactor -> Rename).
重构后构建失败,没有问题。(使用 Edit -> Refactor -> Rename 重命名类)。
The DumbestSolution Ever:
在最愚蠢的解决方案自从:
Go refactor (rename) something else (-_-"). After doing that, the error was that Xcode failed to rename all appropriate files, and didn't show errors. Then, after another refactor, the errors from the previous refactor appeared.
去refactor(rename)别的东西(-_-”)。这样做之后,错误是Xcode未能重命名所有适当的文件,并且没有显示错误。然后,再次重构后,出现了上次重构的错误.
回答by Hai Feng Kao
The above solutions do not work for me.
上述解决方案对我不起作用。
My solution is to move the project to another folder.
我的解决办法是把项目移到另一个文件夹。
The build errors then just appear as normally did.
然后构建错误就像往常一样出现。