Title: Android: Crash with "markingMode: none" and "ngFor" with binding · Issue #6983 · NativeScript/NativeScript · GitHub
Open Graph Title: Android: Crash with "markingMode: none" and "ngFor" with binding · Issue #6983 · NativeScript/NativeScript
X Title: Android: Crash with "markingMode: none" and "ngFor" with binding · Issue #6983 · NativeScript/NativeScript
Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.2 Android Runtime: 5.2.1 Describe the bug With "markingMode: none", errors "Attempt to use cleared object reference" occur when I change the background color of an element in my app with...
Open Graph Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.2 Android Runtime: 5.2.1 Describe the bug With "markingMode: none", errors "Attempt to use cleared object reference" occur when I change the backg...
X Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.2 Android Runtime: 5.2.1 Describe the bug With "markingMode: none", errors "Attempt to use cleared object reference" occur whe...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/6983
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Android: Crash with \"markingMode: none\" and \"ngFor\" with binding ","articleBody":"**Environment**\r\n - CLI: 5.2.0\r\n - Cross-platform modules: 5.2.2\r\n - Android Runtime: 5.2.1\r\n\r\n**Describe the bug**\r\n- With \"markingMode: none\", errors \"Attempt to use cleared object reference\" occur when I change the background color of an element in my app with a css class name. ([class.element-active]=\"...\")\r\n- It doesn't seems to happen when I change the color or the opacity, only the background-color.\r\n- It doesn't seems to happen when I use \"[style.background-color]=...\"\r\n- My app freeze too often without the \"markingMode: none\"\r\n\r\nI don't know if it's related to NativeScript or NativeScript-Angular\r\n\r\n**To Reproduce**\r\n- I did not succeed in reproducing it on a blank app, but the garbage collector is probably less often triggered with an empty app.\r\n\r\nDo you have any tips to help test this kind of case?\r\n\r\n**Expected behavior**\r\nNo crash ;-)\r\n\r\n**Sample project**\r\n```\r\nexport class MyComponent {\r\n public activeElement: Element | null = null;\r\n public elements: Element[] = [...];\r\n}\r\n```\r\n```\r\n.element {\r\n background-color: white;\r\n}\r\n.element-active {\r\n background-color: red;\r\n}\r\n```\r\n```\r\n\u003cLabel\r\n [text]=\"element.title\"\r\n (tap)=\"activeElement = element\"\r\n class=\"element\"\r\n [class.element-active]=\"element === activeElement\"\r\n *ngFor=\"let element of elements\"\r\n\u003e\u003c/Label\u003e\r\n```\r\n**Additional context**\r\n\r\n```\r\nERROR Error: com.tns.NativeScriptException: Attempt to use cleared object reference id=4370\r\n com.tns.Runtime.getJavaObjectByID(Runtime.java:1006)\r\n com.tns.Runtime.callJSMethodNative(Native Method)\r\n com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1203)\r\n com.tns.Runtime.callJSMethodImpl(Runtime.java:1083)\r\n com.tns.Runtime.callJSMethod(Runtime.java:1070)\r\n com.tns.Runtime.callJSMethod(Runtime.java:1050)\r\n com.tns.Runtime.callJSMethod(Runtime.java:1042)\r\n com.tns.gen.java.lang.Object_vendor_177265_32_TouchListenerImpl.onTouch(Object_vendor_177265_32_TouchListenerImpl.java:18)\r\n android.view.View.dispatchTouchEvent(View.java:11772)\r\n android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)\r\n android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)\r\n android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)\r\n android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657)\r\n android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.j...\r\n\r\nERROR CONTEXT {\r\n \"view\": {\r\n \"def\": {\r\n \"nodeFlags\": 9125889,\r\n \"rootNodeFlags\": 1,\r\n \"nodeMatchedQueries\": 0,\r\n \"flags\": 0,\r\n \"nodes\": [\r\n {\r\n \"nodeIndex\": 0,\r\n \"parent\": null,\r\n \"renderParent\": null,\r\n \"bindingIndex\": 0,\r\n \"outputIndex\": 0,\r\n \"checkIndex\": 0,\r\n \"flags\": 1,\r\n \"childFlags\": 9125888,\r\n \"directChildFlags\": 9125888,\r\n \"childMatchedQueries\": 0,\r\n \"matchedQueries\": {},\r\n \"matchedQueryIds\": 0,\r\n \"references\": {},\r\n \"ngContentIndex\": null,\r\n \"childCount\": 3,\r\n \"bindings\": [\r\n {\r\n \"flags\": 8,\r\n \"ns\": \"\",\r\n \"name\": \"text\",\r\n \"nonMinifiedName\": \"text\",\r\n \"securityContext\": 0\r\n },\r\n {\r\n \"flags\": 2,\r\n \"ns\": \"\",\r\n \"name\": \"element-active\",\r\n \"nonMinifiedName\": \"element-active\"\r\n }\r\n ],\r\n \"b...\r\n```\r\n\r\n\"element-active\" is the added css class name containing a change of background-color.\r\n\r\n","author":{"url":"https://github.com/jpierront","@type":"Person","name":"jpierront"},"datePublished":"2019-03-04T13:47:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/6983/NativeScript/issues/6983"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:21d0b287-bbde-f91b-43c4-c1e94dc85ea6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8C2:1A5CF4:7D17A:A8F23:6973C1EB |
| html-safe-nonce | 3a821dce3f92f3d5181603ee184e300c2a70db883118e8d7bc43dd0d1c7f5345 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEMyOjFBNUNGNDo3RDE3QTpBOEYyMzo2OTczQzFFQiIsInZpc2l0b3JfaWQiOiI2MTM0MDkwMDkxMDAzNzQ1MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 84415a9eae218f2efb86e8e9d2fba8f0a60b3c2a3bd1a40727f07de6f27add28 |
| hovercard-subject-tag | issue:416808988 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/NativeScript/6983/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a8d537d2bd9cdd6cf980f3d9edc00fe331835199a3ee322b0fe94e042a5b691/NativeScript/NativeScript/issues/6983 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a8d537d2bd9cdd6cf980f3d9edc00fe331835199a3ee322b0fe94e042a5b691/NativeScript/NativeScript/issues/6983 |
| og:image:alt | Environment CLI: 5.2.0 Cross-platform modules: 5.2.2 Android Runtime: 5.2.1 Describe the bug With "markingMode: none", errors "Attempt to use cleared object reference" occur when I change the backg... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jpierront |
| hostname | github.com |
| expected-hostname | github.com |
| None | acb8c988baca9616cb18bcb596629b823688faa1ef21a000061fe3616b4e3605 |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | af4eb23c75c70abd61c0b216b767faf4c9a30817 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width