{ "id": "79635", "key": "TIMOB-5212", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-08-22T16:54:34.000+0000", "created": "2011-08-25T09:49:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "builder.py", "density", "images", "resources", "simulator" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-30T22:06:32.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Platform-specific images are placed in the following project directories:\r\n\r\n{code}\r\nResources/android/images/high/ic_tab_home.png\r\nResources/android/images/medium/ic_tab_home.png\r\nResources/android/images/low/ic_tab_home.png\r\nResources/iphone/images/ic_tab_home.png\r\nResources/iphone/images/ic_tab_home@2x.png\r\n{code}\r\n\r\nThese are used to set icons to tabs, in the following working code:\r\n\r\n{code:javascript|title=app.js}\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Ti.UI.createTab({\r\n icon:\"/images/ic_tab_home.png\",\r\n title:'Tab 1',\r\n top:0,\r\n left:0,\r\n right:0,\r\n bottom:0,\r\n width:'100%',\r\n height:'100%',\r\n window:win1\r\n});\r\n\r\ntabGroup.addTab(tab1);\r\n\r\ntabGroup.open();\r\n{code}\r\n\r\nWhen the iPhone version of {{builder.py}} launches the iOS simulator, it does so in a manner causing the app resources to be loaded from the project root folder instead of the app's resource folder in the iphone build folder. This is causing significant issues when loading device specific resources residing in the {{Resources/iphone}} folder. For instance, attempting to load the file {{Resources/iphone/images/KS_nav_ui.png}} using the path {{images/KS_nav_ui.png}} or {{/images/KS_nav_ui.png}} no longer works. If you put them in a top level {{/images}} folder, they end up overriding their Android density-specific counterparts when the Android version of {{builder.py}} runs.\r\n\r\nIt appears {{builder.py}} is correctly copying files from the {{Resources/iphone}} folder to the app's resource folder residing at {{build/iphone/build/Debug-iphonesimulator/}}_appname_{{.app}}. For instance, the file {{Resources/iphone/images/KS_nav_ui.png}} is correctly copied to {{build/iphone/build/Debug-iphonesimulator/}}_appname_{{.app/images/KS_nav_ui.png}}. But since the iOS simulator is loading the resources directly from the project root, the files in the app resource folder are ignored.\r\n\r\nAt present... there doesn't appear to be a graceful workaround to this issue without creating a device specific path at runtime and ingesting it into each path reference for device-specific resources, a significant change to any existing codebase of medium or larger size.", "attachment": [], "flagged": false, "summary": "Files in the project root's Resources/iphone folder cannot be loaded by the iOS simulator", "creator": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium Studio, build: 1.0.4.201108101535\r\n* Titanium Mobile SDK 1.7.2\r\n* XCode 4.1 Build 4B110\r\n* iOS SDK 4.3\r\n* Mac OS X 10.7.1", "comment": { "comments": [ { "id": "164715", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Rob\r\n\r\nAre you aware of the [Changes to filesystem on iOS|http://developer.appcelerator.com/blog/2011/05/changes-to-filesystem-on-ios.html]?\r\n\r\nIf this does not solve it, we will need some code that demonstrates the issue.\r\n\r\nWould you update the ticket and let me know?\r\n\r\nThanks", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-31T18:40:20.000+0000", "updated": "2011-08-31T18:40:20.000+0000" }, { "id": "164743", "author": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here's an example... I have an image file ic_tab_home.png for which I have device specific versions of for android and iphone. Based on your SDK docs, the way to accomplish this is to lay it out in the project directory like so....\r\n\r\nResources/android/images/high/ic_tab_home.png\r\nResources/android/images/medium/ic_tab_home.png \r\nResources/android/images/low/ic_tab_home.png\r\nResources/iphone/images/ic_tab_home.png\r\nResources/iphone/images/ic_tab_home@2x.png\r\n\r\nFollowing this convention, any reference to \"/images/ic_tab_home.png\" should load the file specific to the device you are running on, such as in the following code...\r\n\r\nvar homeTab = Titanium.UI.createTab({ \r\n icon:\"/images/ic_tab_home.png\",\r\n title:'Home',\r\n\ttop:0,\r\n\tleft:0,\r\n\tright:0,\r\n\tbottom:0,\r\n\twidth:'100%',\r\n\theight:'100%',\r\n window:homeWin\r\n});\r\n\r\nHowever, as I described in the bug, when the builder launches the emulator, it does so in a manner that causes it to ignore the \"Resources/iphone\" folder when resolving paths.\r\n\r\nThis is really an issue of how builder.py copies over device-specific resources and the way it launches the emulator. In this instance, I'm not making any Titanium.File calls, I'm just following the SDK guidelines for loading device specific resources. I've also spent a considerable amount of time going through builder.py to isolate the issue as I described in the original bug description.\r\n\r\n\r\n", "updateAuthor": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-01T04:44:00.000+0000", "updated": "2011-09-01T04:44:00.000+0000" }, { "id": "164900", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Rob\r\n\r\nI appreciate your effort, but the absolutely crucial thing we need is a piece of code that reproduces the problem. Please would you follow [Creating Good Use-cases|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases] and [Summary: Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist].\r\n\r\nOnce all the information is provided, I can accept the ticket.\r\n\r\nThank you in advance", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-09-02T06:10:54.000+0000", "updated": "2011-09-02T06:10:54.000+0000" }, { "id": "164905", "author": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I did....\r\n\r\nvar homeTab = Titanium.UI.createTab({ icon:\"/images/ic_tab_home.png\", title:'Home', top:0, left:0, right:0, bottom:0, width:'100%', height:'100%', window:homeWin });\r\n\r\nGiven the project layout as I described in great detail above, the image referenced in this code will not load in the iOS simulator as it should as described in the Titanium Mobile documentation. The alternate path \"images/ic_tab_home.png\" will not work either.\r\n\r\n", "updateAuthor": { "name": "cintimedia", "key": "cintimedia", "displayName": "Rob Gabbard", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-02T06:59:28.000+0000", "updated": "2011-09-02T06:59:28.000+0000" }, { "id": "165072", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Rob\r\n\r\nI am happy to move this to the correct project, but in future please be aware that adhering to the [Submitting Bug Reports|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports] guide is a prerequisite to raising tickets.\r\n\r\nThank you\r\n\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-09-06T10:23:56.000+0000", "updated": "2011-09-06T10:23:56.000+0000" }, { "id": "393788", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Unable to reproduce with Titanium SDK master (currently 6.1.0). I'm not sure exactly when it was fixed.\r\n\r\nI tested with images in {{Resources}} and {{Resources/iphone}} as well as {{Resouces/images}} and {{Resources/iphone/images}} and it worked as expected.\r\n\r\nI also tested referencing the image using both relative and absolute paths and it worked as expected.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-22T16:54:35.000+0000", "updated": "2016-08-22T16:54:35.000+0000" }, { "id": "416396", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced, with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-30T22:06:32.000+0000", "updated": "2017-03-30T22:06:32.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }