Xcode 4: Build Failed, No Issues

后端 未结 30 941
再見小時候
再見小時候 2020-12-01 00:39

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

相关标签:
30条回答
  • 2020-12-01 01:13

    Just to add another answer after trying ALL the above without success: I had to restart the MacBook, not only close XCode, and that worked for me. It ended up with XCode showing some errors in the Localizable.strings that it didn't show before.

    Hope that helps

    0 讨论(0)
  • 2020-12-01 01:14

    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.

    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.

    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.

    0 讨论(0)
  • 2020-12-01 01:16

    Is there a space in your Target's Product Name?

    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}.

    0 讨论(0)
  • 2020-12-01 01:17

    I had exactly the same problem when trying to compile an existing project in xcode 4, and very nearly went through the pain of recreating the project.

    However, in a last ditch attempt I replaced the info.plist file with a newly created one which included the additional tags for "document types", "url types", "Exported Type UTIs" and "Imported Type UTIs"

    This seemed to work and was a surprisingly simple fix for my project.

    0 讨论(0)
  • 2020-12-01 01:19

    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.

    0 讨论(0)
  • 2020-12-01 01:19

    I know what the problem is: In Info.plist -> Bundle Identifier: you can not use '_'. For example, com.mycompany.My_app is not valid, but com.mycompany.My-app OK.

    0 讨论(0)
提交回复
热议问题