So I am interested in developing cross platform mobile apps and Titanium seemed perfect for this. However, I have spent about 5 hours just trying to get the Hello World application running properly on my machine. I have googled these problems to high heaven, but none of the answers that I have found seem to help at all.
Below is the error I get when I try to run a new Hello World Project:
[INFO] One moment, building ...
[INFO] Titanium SDK version: 2.0.2 (05/30/12 10:21 2ff31a3)
[INFO] iPhone Device family: universal
[INFO] iPhone SDK version: 4.1
[INFO] iPhone simulated device: iphone
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60:23: error: expected function body after function declarator
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250:91: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256:86: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258:114: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187:31: error: unknown type name 'UIApplicationState'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190:4: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191:28: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202:45: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206:4: error: expected a type
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82:22: error: unknown type name 'UIDataDetectorTypes'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54:22: error: unknown type name 'UIDataDetectorTypes'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h:60: error: expected initializer before 'AVAILABILITY_INTERNAL__MAC_10_7'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: expected type-specifier before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: expected )' before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:250: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256: error: expected type-specifier before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256: error: expected )' before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:256: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258: error: expected type-specifier before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258: error: expected )' before 'UIViewAnimationOptions'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:258: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:187: error: 'UIApplicationState' has not been declared
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190: error: expected type-specifier before 'UIBackgroundTaskIdentifier'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190: error: expected )' before 'UIBackgroundTaskIdentifier'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:190: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191: error: expected type-specifier before 'UIBackgroundTaskIdentifier'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191: error: expected )' before 'UIBackgroundTaskIdentifier'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:191: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202: error: expected type-specifier before 'UIRemoteNotificationType'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202: error: expected )' before 'UIRemoteNotificationType'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:202: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206: error: expected type-specifier before 'UIRemoteNotificationType'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206: error: expected )' before 'UIRemoteNotificationType'
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:206: error: expected;' before ')' token
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITextView.h:82: error: 'UIDataDetectorTypes' has not been declared
[ERROR] /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h:54: error: 'UIDataDetectorTypes' has not been declared
[ERROR]
[ERROR] Error: Traceback (most recent call last):
File "/Users/csalvato/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/iphone/builder.py", line 1318, in main
execute_xcode("iphonesimulator%s" % link_version,["GCC_PREPROCESSOR_DEFINITIONS=__LOG__ID=%s DEPLOYTYPE=development TI_DEVELOPMENT=1 DEBUG=1 TI_VERSION=%s %s %s" % (log_id,sdk_version,debugstr,kroll_coverage)],False)
File "/Users/csalvato/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/iphone/builder.py", line 1224, in execute_xcode
output = run.run(args,False,False,o)
File "/Users/csalvato/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/iphone/run.py", line 41, in run
sys.exit(rc)
SystemExit: 1
Any advice?
4 Answers
What version of Xcode are you running? Studio 2.0.x requires minimum 4.2.
[INFO] iPhone SDK version: 4.1You've set the iOS target to 5.1, but the iPhone SDK you're using is still 4.1.?
Try pointing your iOS SDK folder to the newer SDK in tiapp.xml GUI Viewer (click on configure...).
The Newsstand errors may be occurring because Newsstand was not available before iOS 5 (as I can remember).
For anyone else with this problem, its because I installed Xcode a long time ago and never really used it. I had installed Xcode 3 which goes into /Developer , and then also installed Xcode 4 into /Developer, and Xcode 4.3.3 (my most recent version) was stored in /Applications/Xcode.app/Contents/Developer.
My problem could have probably been fixed by just doing xcode-select -switch /Applications/Xcode.app/Contents/Developer but I didn`t know that directory even existed. So here is what I did:
- Uninstalled Xcode using
/Developer/Library/uninstall-devtools -mode=all - Deleted all copies of Xcode by running
rm -rf /Developer(I backed it up first, of course) - Deleted all copies of Xcode Apps by running
-rm -rf /Applcations/*Xcode.app - Restarting (for good measure)
- Reinstalled Xcode from the App Store.
- Ran
xcode-select -switch /Applications/Xcode.app/Contents/Developer
Note, that if you want to test for this same error, you need just run xcodebuild -showsdks and you will see what SDKs are installed for xcode. In my Xcode itself, I was seeing 5.1, but in my xcodebuild -showsdks I only saw up to 4.1. Thus, an xcode-select -switch /Applications/Xcode.app/Contents/Developer would have worked by itself, but I didn`t even know that folder existed, so I guess it was better to start fresh.
For anyone else with this problem, its because I installed Xcode a long time ago and never really used it. I had installed Xcode 3 which goes into /Developer , and then also installed Xcode 4 into /Developer, and Xcode 4.3.3 (my most recent version) was stored in /Applications/Xcode.app/Contents/Developer.
My problem could have probably been fixed by just doing xcode-select -switch /Applications/Xcode.app/Contents/Developer but I didn`t know that directory even existed. So here is what I did:
- Uninstalled Xcode using
/Developer/Library/uninstall-devtools -mode=all - Deleted all copies of Xcode by running
rm -rf /Developer(I backed it up first, of course) - Deleted all copies of Xcode Apps by running
-rm -rf /Applcations/*Xcode.app - Restarting (for good measure)
- Reinstalled Xcode from the App Store.
- Ran
xcode-select -switch /Applications/Xcode.app/Contents/Developer
Note, that if you want to test for this same error, you need just run xcodebuild -showsdks and you will see what SDKs are installed for xcode. In my Xcode itself, I was seeing 5.1, but in my xcodebuild -showsdks I only saw up to 4.1. Thus, an xcode-select -switch /Applications/Xcode.app/Contents/Developer would have worked by itself, but I didn`t even know that folder existed, so I guess it was better to start fresh.
Your Answer
Think you can help? Login to answer this question!