{ "id": "63764", "key": "TIMOB-3132", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-08-19T18:46:32.000+0000", "created": "2011-04-15T03:37:43.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "ios", "reported-1.6.0", "rplist" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" }, { "id": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T20:57:10.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": "h4. Problem\r\n\r\nPlatform specific JavaScript files are not considered when the build scripts decide what modules to exclude. That means if you only use Ti.UI.createWindow in a platform specific JavaScript file, you will NOT be able to deploy to device.\r\n\r\nNOTE: This will ONLY show up when you deploy to device! The simulator build scripts don't exclude modules, so this bug will not show up there.\r\n\r\nh4. Error\r\n\r\nWhen deploying to device, the following error will pop up:\r\n\r\n{code}\r\nApplication Error\r\ninvalid method (createWindow) passed to UIModule at createWindow.js (line 2)\r\n{code}\r\n\r\nh4. Sample Code\r\n\r\nPlace the following in your Resources/app.js. Note that you can uncomment the last line to force the build scripts to include Ti.UI.Window.\r\n\r\n{code}\r\n// include a file that attempts to create a new window\r\n// if this file is in the platform build folder, its content won't be used to decide what modules to include\r\nTi.include('createWindow.js');\r\n\r\n// so if we explicitly specify \"we're going to use Ti.UI.Window\", this program will work\r\n// but if you comment out the following line, and deploy to device, this app will NOT work\r\n//Ti.UI.createWindow;\r\n{code}\r\n\r\nNow place the following in Resources/iphone/createWindow.js. Note that if you move it to Resources/createWindow.js (out of the iphone folder), everything will work.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#0f0'\r\n});\r\nwin.open();\r\n{code}\r\n\r\nIf everything works (if the bug is NOT present), you will see a window with a green background.\r\n\r\nh4. Tested On\r\n\r\nTitanium SDK version: 1.6.0 (02/10/11 14:34 9db0685...)\r\nWORKS on iPhone Simulator 4.2\r\nBROKEN on iPod Touch 3rd Generation\r\nWORKS on Android Device 2.1 (when placed in Resources/android folder)\r\n\r\nh4. Workaround\r\n\r\nEither move the code out of the iphone folder, or explicitly force Titanium to include the components that are being excluded by placing the following in your app.js:\r\n\r\n{code}\r\nTi.UI.createWindow; // note that we don't actually call this function; just a reference is enough\r\n{code}\r\n\r\nh4. Associated Helpdesk Ticket\r\n\r\nhttp://developer.appcelerator.com/helpdesk/view/73211", "attachment": [], "flagged": false, "summary": "iOS: Platform Specific JS Not Considered in Build Scripts Exclusion Process", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "192779", "author": { "name": "dynamicdna", "key": "dynamicdna", "displayName": "Heath Hopkins", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The issue has not been resolved as of 2.0.1.GA", "updateAuthor": { "name": "dynamicdna", "key": "dynamicdna", "displayName": "Heath Hopkins", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-26T11:38:15.000+0000", "updated": "2012-04-26T11:38:15.000+0000" }, { "id": "393640", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Resolving this ticket as invalid. In Titanium SDK 3.0.0, we correctly overlay platform specific JS on top of non-platform specific code, then parse and walk the AST to find the native modules being used. This shouldn't be an issue anymore.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-19T18:46:32.000+0000", "updated": "2016-08-19T18:46:32.000+0000" }, { "id": "414940", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T20:57:10.000+0000", "updated": "2017-03-22T20:57:10.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }