Hello World Project Not Building or Simulating

You must Login before you can answer or comment on any questions.

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?

— asked 12 months ago by Chris Salvato
2 Comments
  • I opened my Hello World.xcodeproj file and changed the compiler to GCC 4.2 and the iOS target to 5.1 and now my errors are fewer, but still not getting a successful build...

    [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: ipad
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/NetworkModule.m:252: error: 'UIRemoteNotificationTypeNewsstandContentAvailability' undeclared (first use in this function)
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/NetworkModule.m:252: error: (Each undeclared identifier is reported only once
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/NetworkModule.m:252: error: for each function it appears in.)
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/NetworkModule.m:304: error: 'UIRemoteNotificationTypeNewsstandContentAvailability' undeclared (first use in this function)
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/TiUIiOSAdViewProxy.m:23: error: 'ADBannerContentSizeIdentifierPortrait' undeclared (first use in this function)
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/TiUIiOSAdViewProxy.m:23: error: (Each undeclared identifier is reported only once
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/TiUIiOSAdViewProxy.m:23: error: for each function it appears in.)
    [ERROR] /Users/csalvato/Development/Titanium Projects/Hello World/build/iphone/Classes/TiUIiOSAdViewProxy.m:31: error: 'ADBannerContentSizeIdentifierLandscape' undeclared (first use in this function)
    [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

    — commented 12 months ago by Chris Salvato

  • Should I reinstall Xcode or something?!

    — commented 12 months ago by Chris Salvato

4 Answers

[INFO] iPhone SDK version: 4.1
You'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:

  1. Uninstalled Xcode using /Developer/Library/uninstall-devtools -mode=all
  2. Deleted all copies of Xcode by running rm -rf /Developer (I backed it up first, of course)
  3. Deleted all copies of Xcode Apps by running -rm -rf /Applcations/*Xcode.app
  4. Restarting (for good measure)
  5. Reinstalled Xcode from the App Store.
  6. 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:

  1. Uninstalled Xcode using /Developer/Library/uninstall-devtools -mode=all
  2. Deleted all copies of Xcode by running rm -rf /Developer (I backed it up first, of course)
  3. Deleted all copies of Xcode Apps by running -rm -rf /Applcations/*Xcode.app
  4. Restarting (for good measure)
  5. Reinstalled Xcode from the App Store.
  6. 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!