Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17933] Sanity check required by evaluating deployment-targets in tiapp.xml

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionCannot Reproduce
Resolution Date2019-10-02T05:26:21.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsTooling
LabelsTCSupport
ReporterStephen Feather
AssigneeChris Barber
Created2014-10-22T20:05:00.000+0000
Updated2019-10-21T15:41:38.000+0000

Description

Instructions

From the command line, create an empty project with iphone and android natures/targets. You should be able to build for ios
ti build -p ios
and for android
ti build -p android
without a problem Now open up the tiapp.xml and change
<target device="iphone">true</target>
to
<target device="iphone">false</target>
and build again for ios
ti build -p ios
An error occurs.
[ERROR] Failed to run command "build"
[ERROR] TypeError: Cannot read property 'cyan' of undefined
    at iOSBuilder.loginfo (/Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/iphone/cli/commands/_build.js:1603:73)
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:610:21
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:249:17
    at iterate (/Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:149:13)
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:160:25
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:251:21
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:615:34
    at iOSBuilder.initialize (/Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/iphone/cli/commands/_build.js:1580:2)
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:610:21
    at /Users/stephenfeather/Library/Application Support/Titanium/mobilesdk/osx/3.4.0.GA/node_modules/node-appc/node_modules/async/lib/async.js:249:17
If you change the android target to false, tooling will still blindly build you a nice new android apk.

Impact

Projects setup for iOS only can be tested against ios/android without modification. Projects built for android only (lets say on a windows system and then moved to the mac) need to be modified. The modification is fine, and understandable, but the error message above is not.

Solution

Tooling should check the tiapp.xml to see if an appropriate deployment target exists that matches the target from the command line switches/parameters and inform the user if the original project is missing any components.

Comments

  1. Chris Barber 2019-10-02

    Great news! Sometime in the past 5 years, this was magically fixed.

JSON Source