Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1005] Alloy <Require> doesn't care about the platform attr (parent or itself)

GitHub Issuen/a
Resolution Date2014-05-23T17:33:13.000+0000
Affected Version/sAlloy 1.3.1
Fix Version/sAlloy 1.4.0
Labelsalloy, compile, qe-testadded
ReporterDan Tamas
AssigneeTim Poulsen


Having separate views per platform in the same xml, if we require a file that exists only in the specific folder the alloy compiler will die when trying to compile for the other platform.

	<Window class="container" platform="ios">
		<Label id="label" onClick="doClick">Hello, World</Label>

	        	<Require src="toRequire"/>  


	<Window class="container" platform="android">
		<Label id="label" onClick="doClick">Hello, World</Label>

Trying to compile for android will lead to this:
[INFO]  ----- MVC GENERATION -----
[INFO]  [global style] loading from cache...
[INFO]  [index.xml] view processing...
[INFO]    style:      "index.tss"
[INFO]    view:       "index.xml"
[ERROR] view "toRequire" does not exist.
[ERROR] The following paths were inspected:
[ERROR] /Volumes/Work/tst/app/views/android/toRequire
[ERROR] /Volumes/Work/tst/app/views/toRequire
[ERROR] Alloy compiler failed
*toRequire.xml* needs to exist *ONLY* in the *app/views/ios* folder for the bug to show up. The workaround is to create an empty file in the android folder with the same name (toRequire.xml)


  1. Malcolm Hollingsworth 2014-05-03

    I have also tested this with Dan Tamas and I experience the exact same results. The trigger for failure is the tag - it does not honour its parents platform attribute. Many many tests in various combinations show this simply fails.
  2. Ritu Agrawal 2014-05-07

    Moving this ticket to engineering as I can reproduce this issue with the provided test case.
  3. Tim Poulsen 2014-05-23

    This ticket has been fixed by a change made in the linked ticket
  4. Tim Poulsen 2014-05-23

    Resolved by a change made as part of the fixes for ALOY-691.
  5. Federico Casali 2014-05-23

    Verified fixed on iOS, Android and MobileWeb. TiSDK 3.3.0.v20140522144936 Alloy 1.4.0-alpha4 Appcelerator Studio CLI 3.3.0-alpha5 Closing.

JSON Source