[TIMOB-5114] Platform specific includes does not work for iphone
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2011-11-07T17:17:31.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Sprint 2011-44 |
Components | iOS |
Labels | dr-list |
Reporter | Igor Kucheinyk |
Assignee | Blain Hamon |
Created | 2011-08-26T01:23:35.000+0000 |
Updated | 2017-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
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.
Removed 1.8.0 Release label. the code has not been merged.
Workaround for iphone: Let's say you have a file named
test.js
in yourResources/iphone
directory. To include it in your project in the simulator and device, you need to use 2 different methods: * On simulator, includeiphone/
at the beginning of your paths. So in this case, your path should be:iphone/test.js
* On device, exclude theiphone/
path prefix. Your path would then simply be:test.js
.Double-checked on master, appears to work, and yes, is a duplicate of another bug in a way.
Closing ticket as duplicate.