{ "id": "170028", "key": "AC-5286", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2017-12-18T21:12:50.000+0000", "created": "2017-10-16T19:57:15.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-12-18T21:12:50.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I have a webview that I use evalJS to call a function inside it that changes the content of its html. The app will crash when the javascript inside the webview try to add a paragraph to the html for example.\r\n\r\nThis bug is only happening on Android 4.1.1. I tried the following SDKs: 6.1.2, 6.2.2 and SDK 6.3.0.v20171016053946 and the bug is happening in all of them.\r\n\r\nThe line that causes the app to crash is the following line inside the webview:\r\n{code:javascript}\r\ndiv.appendChild(paragraph);\r\n{code}\r\n\r\nAnother way to change the content would simply be:\r\n{code:javascript}\r\ndiv.innerHTML = '

' + text + '

'\r\n{code}\r\nBut this causes crash too.\r\n\r\nI also tried to replace evalJS usage with Ti.App.fireEvent and calling SetTextContent inside Ti.App.addEventListener on the webview but the bug still happens.\r\n\r\nCode to reproduce:\r\n\r\n{code:html}\r\n\r\n\r\n\r\n\r\n\r\n\t
\r\n\t\r\n\r\n\r\n{code}\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar webView = Ti.UI.createWebView({\r\n\turl: '/test.html'\r\n});\r\nwindow.add(webView);\r\n\r\nwindow.open();\r\n\r\nsetInterval(function() {\r\n\twebView.evalJS('SetTextContent(\\'testing' + Math.random() + '\\')');\r\n}, 3000);\r\n{code}", "attachment": [], "flagged": false, "summary": "App crashes when executing evalJS in a webview to change its contents (Ti SDK 6 and Android 4.1.1 only)", "creator": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 6.2.2\r\nAndroid 4.1.1", "comment": { "comments": [ { "id": "429267", "author": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can anyone verify this issue please?", "updateAuthor": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-18T23:37:58.000+0000", "updated": "2017-10-18T23:37:58.000+0000" }, { "id": "430467", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Is this only happening on Android 4.1.1? I tried on a different version. wasn't able to reproduce. Can you try on the latest SDK 6.3.0.GA? Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-11-12T19:20:21.000+0000", "updated": "2017-11-12T19:20:21.000+0000" }, { "id": "431014", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~davidbenko], I just wanted to follow up here. Did you manage to follow the instructions provided earlier? Let us know if you still experience any issue. We would be happy to assist you.\r\nBest Regards!", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-20T09:15:22.000+0000", "updated": "2017-11-20T09:15:22.000+0000" }, { "id": "431062", "author": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello, the test case I provided is now indeed working in SDK 6.3.0. However, the webview is still crashing the app with other use cases. I'll try to provide a new code to reproduce.", "updateAuthor": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-20T23:28:37.000+0000", "updated": "2017-11-20T23:28:37.000+0000" }, { "id": "431076", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~davidbenko] Thanks for your feedback. We will be waiting for your new test code.\r\n\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-21T05:04:24.000+0000", "updated": "2017-11-21T05:04:24.000+0000" }, { "id": "431507", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~davidbenko],
\r\nJust passing a followup here.Are you able to get that sorted out?  Please let us know if you need more help with this issue.\r\nRegards
\r\nAxway Appcelerator Support", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-11-30T04:58:04.000+0000", "updated": "2017-11-30T04:58:04.000+0000" }, { "id": "431646", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "\r\nHello [~davidbenko], Are you still having the issue?Please let us know if you need more help with this issue.\r\nRegards
\r\nAxway Appcelerator Support\r\n\r\n", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-12-04T04:47:29.000+0000", "updated": "2017-12-04T04:47:29.000+0000" }, { "id": "431689", "author": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello, thanks for getting back to me. I'm working on provide an example to reproduce the issue. My app is large and does a buch of interactions with the webview, so I'm trying reducing the problem to a reproducible test case", "updateAuthor": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-04T18:48:15.000+0000", "updated": "2017-12-04T18:48:15.000+0000" }, { "id": "431712", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~davidbenko],Ok. Thanks for your update. We appreciate it. We will be waiting for your reproducible test case.\r\n\r\nBest", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-12-05T04:31:44.000+0000", "updated": "2017-12-05T04:31:44.000+0000" }, { "id": "432256", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~davidbenko], Did you manage to generate the reproducible test case?", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-12-17T08:22:14.000+0000", "updated": "2017-12-17T08:22:14.000+0000" }, { "id": "432310", "author": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Mostafizur, I'm having a hard time trying to reduce to a small test case because the app is large. Anyways we already solved the issue by changing some things in our app so the bug is not happening anymore. You can close the issue", "updateAuthor": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-12-18T21:07:32.000+0000", "updated": "2017-12-18T21:07:32.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }