{ "id": "164808", "key": "TIMOB-24191", "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-12-05T16:00:27.000+0000", "created": "2016-12-02T13:33:19.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "regression" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2017-10-27T08:45:05.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": "I use a web view to load a html file to present a graph. When loading the libraries I get an error in 6.0.0GA but not in 5.5.1GA.\r\n\r\n[ERROR] : AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources//ui/common/RGraph.common.core.js.lib\r\n[ERROR] : AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources//ui/common/RGraph.common.dynamic.js.lib\r\n[ERROR] : AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources//ui/common/RGraph.line.js.lib\r\n\r\n{code:html}\r\n\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n \t\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Unable to load asset from the resources directory in 6.0.0.GA", "creator": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 770, "state": "closed", "name": "2016 Sprint 25 SDK", "startDate": "2016-12-03T01:53:07.491Z", "endDate": "2016-12-17T01:53:00.000Z", "completeDate": "2016-12-21T03:19:43.884Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "402468", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cwilliams] Could this be caused by the require-changes in 6.0.0? If so, we could look into this for 6.0.1. Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-02T16:01:19.000+0000", "updated": "2016-12-02T16:01:19.000+0000" }, { "id": "402469", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~mollin] Can you upload the used JS files for us? Then I'll attach them to the ticket to have a 1:1 use-case. Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-02T16:06:14.000+0000", "updated": "2016-12-02T17:49:45.000+0000" }, { "id": "402506", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried to reproduce the issue with this environment:\r\nNPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.1\r\nAppc CLI: 6.0.0\r\nAppc CLI NPM: 4.2.8\r\nTitanium SDK version: 6.0.0GA\r\nAppcelerator Studio, build: 4.8.0.201611121409\r\nXcode 8.1 GM\r\n\r\nI did not see the error with 5.5.1 GA, however, I was also not able to reproduce the error messages using 6.0.0 GA as reported in the ticket. Here is the code I used:\r\n\r\napp.js:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar webView = Ti.UI.createWebView({\r\n url: \"myLocalWebView.html\"\r\n});\r\nwin.add(webView);\r\nwin.open();\r\n{code}\r\n\r\nmyLocalWebView.html:\r\n{code}\r\n\r\n\r\n\t\r\n\t\tA test app\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n \t\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nLocated in Resources folder:\r\nmyLocalWebView.html\r\nRGraph.common.core.js.lib\r\nRGraph.common.dynamic.js.lib\r\nRGraph.line.js.lib\r\n\r\nThe RGraph js files were downloaded from the RGraph website, and I added the .lib to the file names to match the names in the html file.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-02T22:39:38.000+0000", "updated": "2016-12-02T22:39:38.000+0000" }, { "id": "402508", "author": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "My lib files are locates in Resources/ui/common. It happens only for Android\r\n\r\n*HTML file*:\r\n\r\n{code:html}\r\n\r\n\r\n\t\r\n\t\tline\r\n\t\t \r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\r\n
\r\n \t[Please wait...] \r\n
\r\n\r\n\r\n{code}\r\n\r\n*Setup WebView*:\r\n{code:javascript}\r\n\tif (epr.android) {\r\n\t\tvar url = 'line_chart.html';\r\n\t} else {\r\n\t\tvar url = 'ui/common/line_chart.html';\r\n\t}\r\n\t\t\r\n\tvar wvChart = Titanium.UI.createWebView({\r\n\t\t borderRadius: 1,\r\n\t\t height:300,\r\n\t\t left:0, \r\n\t\t top:70,\r\n\t\t borderRadius:0,\r\n\t\t zIndex:99999,\r\n\t\t url:url\r\n\t});\r\n{code}\r\n*If loaded, fire event*:\r\n{code:javascript}\r\n\twvChart.addEventListener('load',function(e){\r\n\t if (line.title == undefined || line.min>line.max || line.min == 'NaN' || line.max == 'NaN'){\r\n\t \tTi.App.fireEvent(\r\n\t\t\t\t\t'app:closeChart', {});\r\n\t }\r\n\r\n\t\tvar w = labResultShow[0].getContentWidth();\r\n\t\tif (w < epr.maxX || w == null){\r\n\t\t\tw = epr.maxX;\r\n\t\t}\r\n\t\t\r\n\t\tTi.App.fireEvent(\r\n\t\t\t'app:renderChart', {\r\n\t\t\t\ty: line.y,\r\n\t\t\t\tx: line.x, \r\n\t\t\t\tlabel: line.yValue,\r\n\t\t\t\tcount: line.count,\r\n\t\t\t\ttitle: line.title,\r\n\t\t\t\tmax:line.max,\r\n\t\t\t\tmin:line.min,\r\n\t\t\t\thi:line.hi_bound,\r\n\t\t\t\tlo:line.lo_bound,\r\n\t\t\t\tunit:line.par_unit,\r\n\t\t\t\twidth:w,\r\n\t\t \theight:300\t\t \r\n\t\t}); \r\n\t});\t\r\n{code}\r\n", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-02T23:30:32.000+0000", "updated": "2016-12-05T15:24:58.000+0000" }, { "id": "402551", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "I'm also unable to reproduce this error. I don't think this is an SDK bug. If I look at the code you mention above:\r\n\r\n{code:javascript}\r\nif (epr.android)\r\n{ var url = 'line_chart.html'; }\r\nelse\r\n{ var url = 'ui/common/line_chart.html'; }\r\n{code}\r\n\r\nIt looks to me like on Android you're loading web view content at /Resources/line_chart.html, while on other platforms (iOS), it's at {{/Resources/ui/common/line_chart.html}}. Given the JS script references are relative, that means that {{/Resources/ui/common/line_chart.html}} will load the JS files inside {{/Resources/ui/common}} fine; whereas {{/Resources/line_chart.html}} would expect them to live inside {{/Resources/}}", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-05T15:58:10.000+0000", "updated": "2016-12-05T15:59:14.000+0000" }, { "id": "402552", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Marking as invalid for now until we can see a reproducible case of this. QE and two SDK engineers were all unable to reproduce.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-05T16:00:28.000+0000", "updated": "2016-12-05T16:00:28.000+0000" }, { "id": "402553", "author": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hallo Chris,\r\nyou might be right. But the example was working since 5.5.1GA. I didn’t change anything at that point. But it doesn’t work if i use the same url as for iOS. Please tell me what the correct url ist?\r\n\r\nRegards\r\nJoachim", "updateAuthor": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-05T16:06:50.000+0000", "updated": "2016-12-05T16:06:50.000+0000" }, { "id": "402577", "author": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "body": "HI,\r\n\r\nyou are right. It works with /ui/common/line_chart.html. Thanks for your help.\r\n\r\nThen it must be a bug in older version as it works with 5.5.1GA\r\n", "updateAuthor": { "name": "mollin", "key": "mollin", "displayName": "Joachim Mollin", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-05T19:21:20.000+0000", "updated": "2016-12-05T19:21:20.000+0000" }, { "id": "414401", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:01:10.000+0000", "updated": "2017-03-21T21:01:10.000+0000" }, { "id": "429725", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi guys,\r\nI have similar problem - I have webview.html in Resources folder and inside it I link webview.js via\r\n{code:java}\r\n\r\n{code}\r\nit throws me error:\r\nAndroidProtocolHandler: Unable to open asset URL: file:///android_asset/Resources//webview.js\r\nI'm using Ti.SDK 6.2.2GA on macOS Sierra and Nexus5x@Android 7.1\r\nCan you please help me?\r\nThanks", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-10-27T07:13:09.000+0000", "updated": "2017-10-27T07:13:09.000+0000" }, { "id": "429728", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Hi guys,\r\nI found solution - problem was, that I created Ti.UI.webview from socket.js file which is required in app.js.\r\nI moved Ti.UI.webview to app.js and now it's working without that error.\r\n", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2017-10-27T08:45:05.000+0000", "updated": "2017-10-27T08:45:05.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }