{ "id": "109910", "key": "TIMOB-12798", "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": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15277", "description": "2013 Sprint 06 Core", "name": "2013 Sprint 06 Core", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-19T22:57:35.000+0000", "created": "2013-02-20T15:33:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "core", "defect", "include", "qe-port", "regression" ], "versions": [], "issuelinks": [ { "id": "25953", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "100491", "key": "TIMOB-10783", "fields": { "summary": "Android: Window url is assumed relative to calling js file directory, causes FileNotFoundException", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-21T10:46:23.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2.Problem\r\nWhen a window with a url property is created from within a CommonJS unit, where the CommonJS unit resides in a subdirectory, includes that are within the window's unit (specified in the url property) used to be (2.1.4 and earlier) treated as relative to the Resources directory. Now (3.0.2.GA) it is treated as relative to the directory of the CommonJS file. If the CommonJS file is in a subdirectory, an error (APP PROXY: ti.modules.titanium.app.AppModule) is generated. This breaks a lot of existing code.\r\n\r\nNote that in the error message, the \"ui\" subdirectory is doubled:\r\nError while reading asset \"Resources/ui/ui/MyInclude.js\"\r\n\r\nWorks in 2.1.4.GA\r\nBroken in 3.0.2.GA\r\n\r\nh2.Testcase\r\nNote in this example that the \"MakeWin.js\" and \"MyInclude.js\" files are in a \"ui\" subdirectory.\r\n\r\n{panel:title=app.js}\r\n{code}\r\nTi.UI.setBackgroundColor('#000');\r\nrequire('ui/MakeWin');\r\n{code}\r\n{panel}\r\n\r\n{panel:title=ui/MakeWin.js}\r\n{code}\r\nvar win1=Ti.UI.createWindow({ \r\n title:'Window 1',\r\n backgroundColor:'#fff',\r\n url:'win1.js'\r\n});\r\nwin1.open();\r\n{code}\r\n{panel}\r\n\r\n{panel:title=win1.js}\r\n{code}\r\nTi.include('ui/MyInclude.js');\r\n\r\nvar winOne = Ti.UI.currentWindow;\r\n\r\nvar label1 = Ti.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window '+MyValue,\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n\r\nwinOne.add(label1);\r\n{code}\r\n{panel}\r\n\r\n{panel:title=ui/MyInclude.js}\r\n{code}\r\nvar MyValue=5;\r\n{code}\r\n{panel}\r\n\r\nh2.Error Log:\r\n[ERROR][TiApplication( 386)] (KrollRuntimeThread) [1417,1417] APP PROXY: ti.modules.titanium.app.AppModule@43e51900\r\n[ERROR][TiAssetHelper( 386)] Error while reading asset \"Resources/ui/ui/MyInclude.js\":\r\n[ERROR][TiAssetHelper( 386)] java.io.FileNotFoundException: Resources/ui/ui/MyInclude.js\r\n[ERROR][TiAssetHelper( 386)] \tat android.content.res.AssetManager.openAsset(Native Method)\r\n[ERROR][TiAssetHelper( 386)] \tat android.content.res.AssetManager.open(AssetManager.java:313)\r\n[ERROR][TiAssetHelper( 386)] \tat android.content.res.AssetManager.open(AssetManager.java:287)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.util.KrollAssetHelper.readAsset(KrollAssetHelper.java:77)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:140)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:166)\r\n[ERROR][TiAssetHelper( 386)] \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n[ERROR][TiAssetHelper( 386)] \tat android.os.Looper.loop(Looper.java:123)\r\n[ERROR][TiAssetHelper( 386)] \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)", "attachment": [], "flagged": false, "summary": "Android: include parameter is assumed relative to CommonJS file directory, causes FileNotFoundException ", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "- Android 2.2 emulator\r\n- Titanium Mobile SDK 3.0.2.GA\r\n- Titanium Studio 3.0.3.201302141237\r\n\r\n", "comment": { "comments": [ { "id": "242835", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/3986", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-19T02:09:21.000+0000", "updated": "2013-03-19T02:09:21.000+0000" }, { "id": "243385", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Environment used for verification -\r\nTitanium SDK: 3.1.0.v20130320190115\r\nTitanium  Studio:3.0.2.201302151605\r\nDevice: LG-P970\tAndroid 2.2.2", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T10:46:23.000+0000", "updated": "2013-03-21T10:46:23.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }