Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5114] Platform specific includes does not work for iphone

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2011-11-07T17:17:31.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sSprint 2011-44
ComponentsiOS
Labelsdr-list
ReporterIgor Kucheinyk
AssigneeBlain Hamon
Created2011-08-26T01:23:35.000+0000
Updated2017-03-14T05:11:13.000+0000

Description

Including the file from iphone folder fails with error Could not fild the file, see steps for details *Steps to reproduce:* 1. Create new Titanium Mobile project 2. Add the following line to the file *Resources/app.js*
Ti.include('ui.js');
3. Create the file ui.js in the folder *Resources/iphone* with the code
alert('Iphone');
4. Create the file ui.js in the folder *Resources/android* with the code
alert('Android');
5. Run the app in android emulator 6. Run the app in iphone simulator *Actual result:* When running on android it works with no problem (alert appears on the screen). For iphone it fails with error Could not fild the file ui.js Expected to work similar for both platforms

Comments

  1. Tim Poulsen 2011-08-29

    I can confirm the behavior with SDK 1.7.0, 1.7.1, and 1.7.2. However, platform-specific includes work as expected on iPhone with SDK 1.6.2.
  2. Don Thorp 2011-08-29

    Removed 1.8.0 Release label. the code has not been merged.
  3. Tony Lukasavage 2011-10-26

    Workaround for iphone: Let's say you have a file named test.js in your Resources/iphone directory. To include it in your project in the simulator and device, you need to use 2 different methods: * On simulator, include iphone/ at the beginning of your paths. So in this case, your path should be: iphone/test.js * On device, exclude the iphone/ path prefix. Your path would then simply be: test.js.
  4. Blain Hamon 2011-11-07

    Double-checked on master, appears to work, and yes, is a duplicate of another bug in a way.
  5. Lee Morris 2017-03-14

    Closing ticket as duplicate.

JSON Source