Errors while building a Titanium project are usually due to configuration issues. The most common problems and possible solutions are posted here.
Run/Debug icons are greyed out
This appears to be related to the project no long being recognized as a Titanium project. You can check this by noticing the absence of a "M" or "D" on the project folder.
- Follow the steps here and choose either the settings for Titanium Mobile or Titanium Desktop.
- You might need to restart Studio.
Build error in console output
Sometimes your project fails to build, but it's not clear if it's an issue with Studio, or perhaps there is a bug in the SDK. To isolate this problem, you can try building from the command line using the exact same parameters as Studio.
- Go to Preferences > Studio > Troubleshooting.
- Change the dropdown to "All"
- Check on "debug specific components"
- Check on "com.aptana.core/debug/shell"
- Save and exit the preference menu
- Re-run the build. View the Studio log file (Help > Studio > View Log file)
- You should see an entry like:
- Open a terminal window and paste in the first line (the whole line, starting with the reference to Python), as shown below:
Does the process give the same error?
"iOS SDK version XXX not found"
This will happen if you have upgraded your iOS SDKs, and the old one is not available. To fix:
- Select Run > Run Configurations... (you will get to the same spot if you choose Debug Configurations...
- Select the configuration for the project you are having an issue with.
- Choose an available iOS SDK from the list.
- Save and close the dialog.
"Could not locate the Android SDK at the given path"
This usually appears inside the "Titanium" preference page inside Studio. Titanium Studio runs a Python script to determine your current configuration. To diagnose the exact issue, please try the following:
- Turn on debug logging: Debugging Studio, and enable specific component "com.aptana.core/debug/shell".
- Re-open the preference page.
- Open the Studio log file (Help > Titanium Studio > View Log File) and scroll to the end.
- You should see a command line invocation of avd.py, ex:
- Copy and paste that complete command line into a terminal window and run it. Check the output. If it doesn't find "Android 2.2", the configuration will be marked as invalid.
It may be that you don't have an "avd.py" script at the location it's looking. to solve that, just install the latest Continuous Build, ensuring that you choose the master branch from the drop-down menu of the download site, and restart Studio.
iOS configuration issues
This usually appears inside the "Titanium" preference page inside Studio. Titanium Studio runs some commands to determine your current configuration:
- To determine the location of your xcode tooling, it runs
- It then looks at /Platforms/iPhoneSimulator.platform/Developer/SDKs underneath that path for the SDK locations.
- Currently, it expecting to see at least one iOS SDK of version greater than or equal to 4.2 and less than 5.1. You can have more installed than that, but you at least need one within that range.
Build error: "No such file or directory"
This can be caused by a few different issues:
- You are running an incompatible version of XCode. Upgrade to the latest version.
- You have not correctly installed the Java JDK.
Xcode not installed
Titanium Studio reports that Xcode is not installed, even though you believe it is. This appears to be caused by a bad install of Xcode. Uninstalling and re-installing Xcode has fixed the issue in every case so far.
You can double check the install location of Xcode by typing the following in Terminal:
Which should print something like '/Developer'
"The directory ... contains 2 projects"
This can happen when renaming an application. To fix this, delete the contents of build/iphone and re-build.