The compiler sets the id of the first top-level XML view element to the default (the controller name) before the platform conditions are evaluated. Now if you have a view in which you use the platform attribute to select which top-level element should be used for each platform, this leads to unpredictable behavior. Only the first (conditional) top-level element will get the default id.
1. Create new project: titanium create -p ios,android -n defaultid --id ti.defaultid -d .
2. Initialize Alloy: cd defaultid && alloy new
3. Replace contents of index.xml with:
4. Compile for iOS: alloy compile -c platform=ios
5. Open Resources/alloy/controllers/index.js and see that the window has correctly been given index as id.
4. Compile for Android: alloy compile -c platform=android
5. Open Resources/alloy/controllers/index.js and see that the window has not been given index as id.