{ "id": "172058", "key": "TIMOB-26300", "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": "20220", "name": "Release 7.3.1", "archived": false, "released": true, "releaseDate": "2018-08-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-21T07:42:05.000+0000", "created": "2018-08-14T10:28:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios" ], "versions": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-21T10:14:57.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": "At version 7.3.0 it seems that the error below appears whereas in version 7.2.0.GA does not.\r\nCheck the above algorithm with the setting “run on main thread” turned off.\r\n\r\n\r\n{code:java}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 28;\r\n[ERROR] : line = 228;\r\n[ERROR] : message = \"Only run on the main thread!\";\r\n[ERROR] : nativeStack = \"3 Foundation 0x00000001109a064f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165\\n4 UIFoundation 0x00000001228d4e9a -[NSLayoutManager(NSPrivate) _resizeTextViewForTextContainer:] + 1178\\n5 UIFoundation 0x00000001228d48c2 -[NSLayoutManager(NSPrivate) _recalculateUsageForTextContainerAtIndex:] + 2232\\n6 UIFoundation 0x000000012290bb10 _enableTextViewResizing + 228\\n7 UIFoundation 0x0000000122910010 -[NSLayoutManager textStorage:edited:range:changeInLength:invalidatedRange:] + 584\\n8 UIFoundation 0x0000000122910064 -[NSLayoutManager processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:] + 47\\n9 UIFoundation 0x000000012293b7f1 -[NSTextStorage _notifyEdited:range:changeInLength:invalidatedRange:] + 168\\n10 UIFoundation 0x000000012293b346 -[NSTextStorage processEditing] + 372\\n11 UIFoundation 0x000000012293af90 -[NSTextStorage endEditing] + 83\\n12 UIKit 0x0000000111bb5516 -[UITextView setAttributedText:] + 254\\n13 UIKit 0x0000000111bbe833 -[UITextView setText:] + 185\\n14 0x000000010dee2f49 -[TiUITextArea textWidgetView] + 393\\n15 0x000000010de77bea -[TiUITextWidget init] + 122\\n16 0x000000010deafb9c -[TiViewProxy newView] + 236\\n17 0x000000010deacc4c -[TiViewProxy view] + 108\\n18 0x000000010dead029 -[TiViewProxy view] + 1097\\n19 0x000000010dead029 -[TiViewProxy view] + 1097\";\r\n[ERROR] : sourceURL = \"file:///Users/..../Library/Developer/CoreSimulator/Devices/7E9AEA65-E384-4187-B67F-273B159CE8DC/data/Containers/Bundle/Application/B1179AAB-1B97-43D5-8AE9-C1242625E85E/.app/ui/templates/listener.js\";\r\n[ERROR] : stack = \" at [native code]\\n at tableViewListener(/ui/templates/listener.js:228:28)\";\r\n[ERROR] : }\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Initializing Ti.UI.TextArea crashes app when running on kroll-thread", "creator": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "440743", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there,\r\n\r\nunfortunately your report does not include much details (the ticket title does not help either). Reading through the exception, it may be around setting the \"value\" property of the Ti.UI.TextArea API, but even that is just wild guessing. Please edit your description with your full environment (iOS version, tiapp.xml configuration) and a reproducible test-case. \r\n\r\n*EDIT*: Looks like I'm right, it's a known issue in the native world as well. I assume you did not migrate your app to run on the main thread so far, which would not cause this issue. You are probably updating your text-area from a background-thread, causing this error. Once you have a reproducible test-case, we can verify that.\r\n\r\nThanks!\r\n\r\n*EDIT 2*: Quick fix: Replace the following line in {{/iphone/Classes/TiUITextWidget.m}}:\r\n{code}\r\n[(id)[self textWidgetView] setText:string];\r\n{code}\r\nwith:\r\n{code:objc}\r\n TiThreadPerformOnMainThread(^{\r\n [(id)[self textWidgetView] setText:string];\r\n }, YES);\r\n{code}\r\n\r\nI am still curious how that could come from SDK 7.3.0, since we did not change anything related to that API in this version.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-14T10:35:11.000+0000", "updated": "2018-08-14T10:43:50.000+0000" }, { "id": "440748", "author": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please check out the following:\r\n\r\n\r\n{code:java}\r\n\r\n\t\t\t\t\t\r\nvar windowA = Ti.UI.createWindow();\r\n\r\nvar\twindowB = Ti.UI.createWindow();\r\n\r\nvar tabA = Ti.UI.createTab({\r\n\twindow:windowA\r\n});\r\n\r\nvar tabB = Ti.UI.createTab({\r\n\twindow:windowB\r\n});\r\n\t\r\nvar tabGroup = Titanium.UI.createTabGroup({\r\n\ttabs:[tabA, tabB]\r\n});\r\n\r\ntabGroup.open();\r\n\r\nwindowA.addEventListener('click', function(e) {\r\n\r\n\tvar win = Ti.UI.createWindow();\r\n\t \t\t\r\n\tvar tableView = Ti.UI.createTableView();\r\n\t\r\n\twin.add(tableView);\r\n\r\n\tvar typingView = Ti.UI.createView();\r\n\t\r\n\tvar keyboardMessageView = Ti.UI.createView();\r\n\t\r\n\tvar keyboardMessage = Ti.UI.createTextArea();\r\n\t\r\n\tkeyboardMessageView.add(keyboardMessage);\r\n\t\r\n\ttypingView.add(keyboardMessageView);\r\n\t\t\r\n\twin.add(typingView);\r\n\t\r\n\ttabA.open(win);\r\n\r\n});\r\n{code}\r\n", "updateAuthor": { "name": "andreas.pingas", "key": "andreas.pingas", "displayName": "Andreas Pingas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-14T13:11:03.000+0000", "updated": "2018-08-14T13:11:03.000+0000" }, { "id": "440753", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10254\r\nPR (7_3_X): https://github.com/appcelerator/titanium_mobile/pull/10255\r\n\r\n(Unit-test included)\r\n\r\nTest-Case:\r\n{code:js}\r\nvar windowA = Ti.UI.createWindow();\r\nvar\twindowB = Ti.UI.createWindow();\r\n\r\nvar tabA = Ti.UI.createTab({\r\n window: windowA,\r\n title: 'Tab A'\r\n});\r\n\r\nvar tabB = Ti.UI.createTab({\r\n window:windowB,\r\n title: 'Tab B'\r\n});\r\n \r\nvar tabGroup = Titanium.UI.createTabGroup({\r\n tabs: [tabA, tabB]\r\n});\r\n\r\nwindowA.addEventListener('open', function() { \r\n var win = Ti.UI.createWindow({ backgroundColor: 'blur' })\r\n var typingView = Ti.UI.createView();\r\n var keyboardMessageView = Ti.UI.createView();\r\n var keyboardMessage = Ti.UI.createTextArea();\r\n\r\n keyboardMessageView.add(keyboardMessage);\r\n typingView.add(keyboardMessageView);\r\n win.add(typingView);\r\n tabA.open(win);\r\n});\r\n\r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-14T13:56:57.000+0000", "updated": "2018-08-14T13:56:57.000+0000" }, { "id": "440927", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-21T10:14:47.000+0000", "updated": "2018-08-21T10:14:47.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }