XCode / iOS Troubleshooting Guide

by Jon (Updated on 2015-03-10)


Let's be honest - the entire iOS toolchain and Xcode can be a pain to work with. For the non-technical amongst us, the errors that Xcode can spit out can be confusing.

This is a list of practically every error we've ever seen our users hit. Chances are good that an error you hit will be on here. If isn't, let us know in the comments or a forum post, and we'll add it.

Note: Much of this guide assumes you've followed the instructions in our iOS certificates primer and know the general concepts behind certificates


What NOT to do

  • Don't reinstall Stencyl. Unless you've tampered with the install, it has nothing to do with these errors.
  • Don't blindly reinstall your certificates or profiles. Sometimes, this helps - if you see something about a certificate expiring, then this is what you do. But more often than not, certificates don't become  "corrupt" (at worst, they've expired, and you can verify this in Keychain Access or from Apple's site), and a cycle of reinstalling them won't help.
  • Don't panic and go on a forum posting binge. Instead, pick apart what the error message is saying, see if this guide already covers it and check on Google before posting on the forums.


The Errors

iOS Simulator

Q: The iOS Simulator does not open.
A: Try reinstalling Xcode from the App Store.

Q: The iOS Simulator opens but the app never runs. You see "iOS Simulator failed to install the application" in the logs.
A: Use the "Reset Content & Settings" option in the simulator.


Xcode / Installation

Q: Can't build (and the logs don't have anything useful). Somewhere in the proces, you upgraded or downgraded Xcode.
A: http://community.stencyl.com/index.php/topic,17227.0.html

Q: You see an error in the logs about "object file format unrecognized, invalid, or unsuitable"
A: Install Xcode Command Line Tools through the Preferences > Downloads screen in Xcode.

Q: You see an error in the logs about "fatal error: 'typeinfo' file not found"
A: Install Command Line Tools from Xcode's Preferences, and run "sudo ln -s /usr/bin/clang /Applications/Xcode.app/Contents/Developer/usr/bin/clang"


Certificates & Signing

Q: You see an error in the logs about "codesign: ambiguous"
A: http://community.stencyl.com/index.php/topic,16959.0.html (check Keychain Access and delete the duplicate certificates that are NOT in the Login keychain)

Q: You see an error in the logs about "Code Sign error: The identity 'iPhone Developer' doesn't match any valid, non-expired certificate/private key pair in your keychains"
A: Two or more possibilities here.

- You didn't specify a password when exporting the p12 file or entered in an incorrect password.

- Your p12 was exported from the Developer certificate, rather than the Distribution certificate. Reexport it. This mistake is very common. http://community.stencyl.com/index.php/topic,18087.0.html

Q: You see an error in the logs about "no identity found"
A: Several possibilities similar to the above.

- Your certificate expired (check Keychain Access or the Apple Developer Portal).

- You exported the Development, rather than Distribution certificate or provisioning profile.

- You didn't specify a password when exporting the p12 file or entered in an incorrect password.

Q: You see an error in the logs about "No unexpired provisioning profiles found that contain any of the keychain's signing certificates"
A: From Xcode's application menu, go to Window > Organizer -> Teams (select Your Team) -> Refresh (low right corner)


Testing on a Device

Q: You see "Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found."
A: Go to Xcode > Preferences > View Account Details and update and reinstall your certificates from within Xcode. [SOURCE]

Q: You see something like "AMDeviceInstallApplication failed: -402620395"
A: Three (or more!) possible solutions to this.

- Add your device to the iOS Member Center. To do this, launch Xcode, open up Window > Organizer. Select your device from the DEVICES section of the left pane. Click Add to Member Center (wording may change between versions). [SOURCE]

- Delete the game you're trying to play on your device. Then run again. [SOURCE]

- View the Device's logs in Xcode's Organizer to figure out an alternate reason. In one case, the user's device had a lower iOS version than what he'd specified in Game Settings > Mobile > Versions. [SOURCE]

Q: You see an error about "fruitstrap"
A: There is a mismatch between the certificates installed on your device and your computer. See: http://www.nme.io/community/forums/bugs/fruitstrap-randomly-fails/

Q: You see "syntax error near unexpected token `('" in the logs.
A: Remove parentheses (and spaces) from your Stencyl install path and your game's name.



Q: I get "Please don't add haxe/std to your classpath, instead set HAXE_LIBRARY_PATH env var"
A: Manually delete/remove Haxe from your classpath (usually /usr/lib/haxe)

Q: Is it OK to have an install of Haxe in addition to Stencyl?
A: If everything is working OK, then it's no harm. But if you are running into massive errors, things that are missing, and you know that you installed Haxe in the past, consider uninstalling Haxe.


Tip: Just Google it!

We're hardly experts in deciphering what Xcode has said. Everything you've seen here was discovered via Google, usually from StackOverflow, a popular questions and answers site for programmers.

If ever in doubt, type the error in Google and see what comes up. Chances are high that someone's hit the same error that you have. Even if you don't know what to do, you'll at least share what you've found when you make a forum post and help reach a resolution quicker.

Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!


If by "locked", you mean that it was asleep, then yes, it is better if a device is on and unlocked when running games. This applies to Android too.
1 7 years, 8 months ago
I got an error about fruitstrap but the problem was that my device was still locked.
-1 8 years, 4 months ago

Sign In to Comment