Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12094] CLI : iOS: When invalid code is used in an app.js the pre-compilation phase will fail on iOS device builds

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-12-20T16:21:48.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.1, Release 3.1.0, 2012 Sprint 26 JS, 2012 Sprint 26
ComponentsCLI
Labelsqe-ios100112, qe-port, qe-testadded, regression
ReporterMichael Pettiford
AssigneeChris Barber
Created2012-12-14T00:15:01.000+0000
Updated2017-03-31T22:03:58.000+0000

Description

*Note* The previous behavior is for device builds the app would successfully build, but crash when run on device. Steps to reproduce: 1. Create a default Titanium mobile project in studio 2. Add the following snippet of code to app.js
var win = Ti.UI.createWindow();
     
win.crash(arg){};
3. Build the app for iOS device Actual result: The pre-compilation phase will fail (As per Chris Barber's investigation) but XCode will continue on and install on device. Then an error message will be displayed saying app.js can't be found Expected result: A compilation error should be generated in the uglify step

Comments

  1. Chris Barber 2012-12-14

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3598 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3599
  2. Bert Grantges 2012-12-19

    ALso noticing this with Alloy compilation. When Alloy pre-compile fails, the build execution is not halted.
  3. Ingo Muschenetz 2012-12-20

    For those experiencing the issue, please download the following build of the SDK: * OSX: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-osx.zip * Linux: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-linux.zip * Windows: http://nightlies.s3.amazonaws.com/mobile/mobilesdk-3.0.1.v20121218130634-win32.zip You may install these manually into your SDK folder, or using Studio's *Help > Install Titanium SDK...* menu option
  4. Olga Romero 2013-01-22

    OSX 10.8.2 Ti Studio build: 3.0.1.201212181159 Ti Mobile SDK build: 3.0.2.v20130121140213 Ti Mobile SDK build: 3.1.0.v20130114171802 CLI build version 3.0.23
  5. Olga Romero 2013-01-22

    Closing as fixed. A compilation Error: [TRACE] :  Command /bin/sh failed with exit code 1 [ERROR] :  ** BUILD FAILED ** [ERROR] :  The following build commands failed: [ERROR] :   PhaseScriptExecution Pre-Compile build/test.build/Debug-iphoneos/test-universal.build/Script-DABB369F12E8CB280026A6EA.sh [ERROR] :  (1 failure)
  6. Priya Agarwal 2013-12-20

    Tested Environment: Appcelerator Studio: 3.2.0.201312191455 SDK:3.2.0.v20131218153242 alloy: 1.3.0-cr2 acs: 1.0.11 npm: 1.3.2 titanium: 3.2.0-cr3 titanium-code-processor: 1.1.0-cr2 Xcode:5.0.2 OS: Mac OSX 10.9 When the above code snippet is added the not getting any precompilation error. But the Simulator gets launched and after that error appears CLI as
       [ERROR] Script Error {
       [ERROR]     line = 3;
       [ERROR]     message = "Parse error";
       [ERROR]     name = SyntaxError;
       [ERROR]     sourceId = 292371200;
       [ERROR]     sourceURL = "file:///Users/p.agarwal/Library/Application%20Support/iPhone%20Simulator/7.0.3/Applications/BBE0F93C-CB86-48F9-92FD-59B1B7DFBBEA/defaultProject.app/app.js";
       [ERROR] } 
       
  7. Chris Barber 2013-12-20

    Syntax checking ONLY happens when performing device and distribution builds. If you are building for simulator/emulator, you won't see any JS errors until the app is launched. I've filed TIMOB-16058 to add support for syntax error checking.
  8. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source