Title: Android crash in Google automated tests: onAccessibilityStateChanged: Cannot read properties of null (reading 'set') · Issue #11049 · NativeScript/NativeScript · GitHub
Open Graph Title: Android crash in Google automated tests: onAccessibilityStateChanged: Cannot read properties of null (reading 'set') · Issue #11049 · NativeScript/NativeScript
X Title: Android crash in Google automated tests: onAccessibilityStateChanged: Cannot read properties of null (reading 'set') · Issue #11049 · NativeScript/NativeScript
Description: Issue Description We’re seeing an Android crash that we can reproduce only in Google Play Console automated testing / pre-launch reports (x86 virtual device). We can’t reproduce it locally on physical devices/emulators, but the stack tra...
Open Graph Description: Issue Description We’re seeing an Android crash that we can reproduce only in Google Play Console automated testing / pre-launch reports (x86 virtual device). We can’t reproduce it locally on physi...
X Description: Issue Description We’re seeing an Android crash that we can reproduce only in Google Play Console automated testing / pre-launch reports (x86 virtual device). We can’t reproduce it locally on physi...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/11049
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Android crash in Google automated tests: onAccessibilityStateChanged: Cannot read properties of null (reading 'set')","articleBody":"### Issue Description\n\nWe’re seeing an Android crash that we can reproduce only in Google Play Console automated testing / pre-launch reports (x86 virtual device). We can’t reproduce it locally on physical devices/emulators, but the stack trace consistently points to the accessibility callback path and the fix below stops it in Google tests.\n\n```\nException com.tns.NativeScriptException: Calling js method onAccessibilityStateChanged failed\nTypeError: Cannot read properties of null (reading 'set')\n at com.tns.Runtime.callJSMethodNative\n at com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1384)\n at com.tns.Runtime.callJSMethodImpl (Runtime.java:1270)\n at com.tns.Runtime.callJSMethod (Runtime.java:1257)\n at com.tns.Runtime.callJSMethod (Runtime.java:1235)\n at com.tns.Runtime.callJSMethod (Runtime.java:1231)\n at com.tns.gen.android.view.accessibility.AccessibilityManager_AccessibilityStateChangeListener.onAccessibilityStateChanged (AccessibilityManager_AccessibilityStateChangeListener.java:19)\n at android.view.accessibility.AccessibilityManager.lambda$notifyAccessibilityStateChanged$0 (AccessibilityManager.java:1710)\n at android.view.accessibility.AccessibilityManager$$ExternalSyntheticLambda0.run (Unknown Source:4)\n at android.os.Handler.handleCallback (Handler.java:938)\n at android.os.Handler.dispatchMessage (Handler.java:99)\n at android.os.Looper.loopOnce (Looper.java:201)\n at android.os.Looper.loop (Looper.java:288)\n at android.app.ActivityThread.main (ActivityThread.java:7870)\n at java.lang.reflect.Method.invoke\n at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)\n at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)\n```\n***Suspected root cause in NativeScript core***\n[application.android.ts](https://github.com/NativeScript/NativeScript/blob/1daeed5ca6be91185896b10e0ad5604f5798269a/packages/core/application/application.android.ts#L725)\n\nupdateAccessibilityState() calls:\n```\nsharedA11YObservable.set(...)\n```\nbut sharedA11YObservable can be undefined.\n\nAfter applying this patch to **updateAccessibilityState** function, the crash stopped appearing in Google automated testing:\n```\n if (!sharedA11YObservable) {\n return;\n }\n```\n```\nfunction updateAccessibilityState() {\n if (!sharedA11YObservable) {\n return;\n }\n const accessibilityManager = getAndroidAccessibilityManager();\n if (!accessibilityManager) {\n sharedA11YObservable.set(accessibilityStateEnabledPropName, false);\n sharedA11YObservable.set(touchExplorationStateEnabledPropName, false);\n return;\n }\n sharedA11YObservable.set(accessibilityStateEnabledPropName, !!accessibilityManager.isEnabled());\n sharedA11YObservable.set(touchExplorationStateEnabledPropName, !!accessibilityManager.isTouchExplorationEnabled());\n}\n```\n\n### Reproduction\n\nWe cannot reproduce this crash manually.\nIt appears only in Google Play automated testing / pre-launch reports on an x86 virtual device.\n\n### Relevant log output (if applicable)\n\n```shell\n\n```\n\n### Environment\n\n```yaml\nOS: macOS 26.2\nCPU: (16) arm64 Apple M4 Max\nShell: /bin/zsh\nnode: 25.1.0\nnpm: 11.6.2\nnativescript: 9.0.1\n\n# android\njava: 17.0.17\nndk: Not Found\napis: Not Found\nbuild_tools: Not Found\nsystem_images: Not Found\n\n# ios\nxcode: 26.0.1/17A400\ncocoapods: 1.16.2\npython: Not Found\npython3: 3.9.6\nruby: 3.3.10\nplatforms: \n - DriverKit 25.0\n - iOS 26.0\n - macOS 26.0\n - tvOS 26.0\n - visionOS 26.0\n - watchOS 26.0\n```\n\n### Dependencies\n\n```json\n\"devDependencies\": {\n \"@angular-devkit/build-angular\": \"~16.2.0\",\n \"@angular/compiler-cli\": \"~16.2.0\",\n \"@nativescript/android\": \"9.0.2\",\n \"@nativescript/ios\": \"9.0.2\",\n \"@nativescript/types\": \"9.0.0\",\n \"@nativescript/webpack\": \"5.0.29\",\n \"@ngtools/webpack\": \"~16.2.0\",\n \"@types/url-parse\": \"^1.4.11\",\n \"process\": \"^0.11.10\",\n \"typescript\": \"5.1.6\",\n \"util\": \"^0.12.5\"\n}\n```\n\n### Please accept these terms\n\n- [x] I have searched the [existing issues](https://github.com/NativeScript/NativeScript/issues) as well as [StackOverflow](https://stackoverflow.com/questions/tagged/nativescript) and this has not been posted before\n- [x] This is a bug report\n- [x] I agree to follow this project's [Code of Conduct](https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc)","author":{"url":"https://github.com/pichurichko","@type":"Person","name":"pichurichko"},"datePublished":"2026-01-15T18:26:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/11049/NativeScript/issues/11049"}
| 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:755d58a4-acfb-9a88-4b70-1cc1e26ee9cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 841A:2265AE:24BD3FB:31D4B60:696AD49A |
| html-safe-nonce | b41f576c80fa943a69caa185f32a1a7f9da3a8d87466895fc479674a355d94f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDFBOjIyNjVBRToyNEJEM0ZCOjMxRDRCNjA6Njk2QUQ0OUEiLCJ2aXNpdG9yX2lkIjoiMTEyMDAzOTY0NDc3OTE3MzAxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 09bf878f75aee58b39f7920f9b0afd56cdb4ba03d3692ca7e8b66dd605bb5fb6 |
| hovercard-subject-tag | issue:3818662620 |
| 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/11049/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6df7f2345ec4722f5a70b9122e1e7ee72b1779fad06bce176e1e63030326eb99/NativeScript/NativeScript/issues/11049 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6df7f2345ec4722f5a70b9122e1e7ee72b1779fad06bce176e1e63030326eb99/NativeScript/NativeScript/issues/11049 |
| og:image:alt | Issue Description We’re seeing an Android crash that we can reproduce only in Google Play Console automated testing / pre-launch reports (x86 virtual device). We can’t reproduce it locally on physi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pichurichko |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| 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 | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width