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.
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.
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.
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.
I can't even get the game to open on the simulator, really could use come help from the community
I thought that it would be easy to publish a small update to an older game since all the certificates were still valid and it *-worked before-*
If anyone is pulling their hair out over a no identity found error and you're convinced you've followed all the steps above, you may need a new WWDR certificate. More info:
http://stackoverflow.com/questions/ 35390072/this-certificate-has-an-in valid-issuer-apple-push-services
I have a more or less finished game. Testing in android (via goole playstore) is done.
But I have big difficulties to get an output for iOS.
I tried hard to find solution in the forum here and to google but that did not help a lot (though the manual and post related to certificates very extremely helpful, thank you! By the way: The link in the topic "Xcode / Certificates Troubleshooting Guide" to the assembled list of issues to http://community.stencyl.com/index. php/topic,17064.0.html seems broken :-( )
What I can do:
I can produce *.ipa Files.
I can install them to various iOS devices, also those of friends (so the inclusion of the UDID in the provisioning profile obviously worked) but this just from iTunes on my computer, the same file can not be installed to the same device via iTunes using another (Windows-) Computer (?!).
Where I am failing:
a.) If I send my *.ipa file to other people they cannot install it on their devices using iTunes on there computers
b.) I can not upload my app to iTunes connect because:
- when i create iOS App ID (in the apple developer center) and choose the option "Explicit App ID" I cannot not disable "Game Center" and "In-App Purchase" and make "Provisioning Profiles" (no matter if adHoc or store) and use those to make the ipa-File in stencil and can not upload it with the Application Loader but get the following error messages (shortened by me): "Invalid Code Signing Entitlements.....the bundle contains a key value that is not allowed: 'true' for the key 'get-task-allow' in 'Payload/appname.app/appname" and "Invalid Code Signing. The executable 'Payload/appname.app/appname' must be signed with signed with the certificate that is contained in the provision profile"
- when i create iOS App ID (in the apple developer center) and choose the option "Wildcard App ID" I have to choose a bundle id ending with ".*". I make the provisioning profiles with that but then I can't compile the app with stencil because an app id ending with ".*" is invalid and I get an error code "No provisioning profiles found: No provisioning profiles with a valid signing identity matching the bundle identifier "bundle id" (="... .*") were found.
How can spread my app for testing and how can I upload it to publish it?
Sorry, if my question is stupid.
I am not a Mac user and i just got myself a mac only to be able to publish my app (and future apps) and I am not really a programmer neither.
On Stencyl 3.2 and Xcode 6.1, I was getting Code Sign error ... no identity found, I follower all the stes on the tutorial but it didnt work. It turns out that It was nescesary to add on Xcode> preferences>account the apple id account. Then it worked!
"- You didn't specify a password when exporting the p12 file or entered in an incorrect password."
Having read this, I checked in Stencyl mobile options and read that a .p12 password is optional (how can it be optional if not specifying a password could potentially create technical problems?
Not sure which is correct. Any light you can shed on the topic would be super useful!
hi I try to test my game on iPhone but I got something like this
Automatic provisioning profile selection unavailable: A bundle identifier is required for automatic provisioning profile selection. Either enter a bundle identifier in the Info.plist, or select a provisioning profile to use in the build settings.
any solution for this?
Can build to iOS but cannot run an app. It open a splash screen then return to home screen. I'm using iOS 8.1.1 on iphone 5c.
sugarontop's issue is due to some changes in 7.1 that broke iOS simulator support. This is resolved in Stencyl 3.1 and later.
[LOG] Running command: RUN
[LOG] - Running command: /Users/xxx/Downloads/Stencyl-fullBU N/plaf/haxe/lib/hxtools/1,1,6/templ ates/bin/ios-sim launch /Users/dragusinbogdan/stencylworks/ games-generated/Platformer/Export/i os/build/Release-iphonesimulator/Pl atformer.app --sdk 7.1 --family iphone --retina --timeout 30 --stdout /private/var/folders/ws/41__rh2n4bg cgwslcjmgb4fm0000gn/T/stencyl533875 8615990591886/scratch/ios-sim.log [LOG] dyld: Library not loaded: @rpath/iPhoneSimulatorRemoteClient. framework/Versions/A/iPhoneSimulato rRemoteClient
[LOG] Referenced from: /Users/xxx/Downloads/Stencyl-fullBU N/plaf/haxe/lib/hxtools/1,1,6/templ ates/bin/ios-sim
[LOG] Reason: image not found
[LOG] Finished building for iOS (or errored out): 1
I got the "Code Sign Error... no identity found" issue, it took me a long time to solve it. Turns out I forgot to enter the password for my p12 file.