Title: Error when using animated transition during navigation on Android 21 and 22 · Issue #5674 · NativeScript/NativeScript · GitHub
Open Graph Title: Error when using animated transition during navigation on Android 21 and 22 · Issue #5674 · NativeScript/NativeScript
X Title: Error when using animated transition during navigation on Android 21 and 22 · Issue #5674 · NativeScript/NativeScript
Description: Tell us about the problem An error is thrown if using slide animation during navigation Which platform(s) does your issue occur on? Android Please provide the following version numbers that your issue occurs with: CLI: 4.0.0 Cross-platfo...
Open Graph Description: Tell us about the problem An error is thrown if using slide animation during navigation Which platform(s) does your issue occur on? Android Please provide the following version numbers that your is...
X Description: Tell us about the problem An error is thrown if using slide animation during navigation Which platform(s) does your issue occur on? Android Please provide the following version numbers that your is...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/5674
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when using animated transition during navigation on Android 21 and 22","articleBody":"### Tell us about the problem\r\n\r\nAn error is thrown if using slide animation during navigation\r\n\r\n### Which platform(s) does your issue occur on?\r\n\r\nAndroid\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: 4.0.0\r\n- Cross-platform modules: 4.0.0\r\n- Runtime(s): 4.0.0\r\n- Plugin(s): N/A\r\n\r\n### Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.\r\n\r\nCreate a new {N} application using CLI 4.0.0:\r\n\r\n```\r\ntns create my-app --tsc\r\n```\r\n\r\nOn the main page add a button with a tap event calling into a function that will navigate to a second page:\r\n\r\n```\r\npublic navigateToSecondPage(): void {\r\n topmost().navigate({\r\n moduleName: \"component/component-page\",\r\n animated: true,\r\n transition: {\r\n name: \"slide\",\r\n duration: 200,\r\n curve: \"ease\"\r\n }\r\n });\r\n}\r\n```\r\n\r\nIn the second page view model constructor try to open some url (opening the url doesn't necessarily need to be done inside the constructor - the problem occurs also if this is done inside a click of a button):\r\n\r\n```\r\nimport { Observable } from \"tns-core-modules/data/observable\";\r\nimport { openUrl } from \"utils/utils\";\r\n\r\nexport class ComponentViewModel extends Observable {\r\n constructor() {\r\n super();\r\n openUrl(\"https://www.google.com\");\r\n }\r\n}\r\n```\r\n\r\nOn Android API levels 21 and 22, the following exception is thrown:\r\n\r\n```\r\nW/System.err(16021): java.lang.NullPointerException: Attempt to read from field 'int android.app.Fragment.mContainerId' on a null object reference\r\nW/System.err(16021): at android.app.BackStackRecord$1.onPreDraw(BackStackRecord.java:1127)\r\nW/System.err(16021): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)\r\nW/System.err(16021): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1956)\r\nW/System.err(16021): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)\r\nW/System.err(16021): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)\r\nW/System.err(16021): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)\r\nW/System.err(16021): at android.view.Choreographer.doCallbacks(Choreographer.java:580)\r\nW/System.err(16021): at android.view.Choreographer.doFrame(Choreographer.java:550)\r\nW/System.err(16021): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)\r\nW/System.err(16021): at android.os.Handler.handleCallback(Handler.java:739)\r\nW/System.err(16021): at android.os.Handler.dispatchMessage(Handler.java:95)\r\nW/System.err(16021): at android.os.Looper.loop(Looper.java:135)\r\nW/System.err(16021): at android.app.ActivityThread.main(ActivityThread.java:5221)\r\nW/System.err(16021): at java.lang.reflect.Method.invoke(Native Method)\r\nW/System.err(16021): at java.lang.reflect.Method.invoke(Method.java:372)\r\nW/System.err(16021): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)\r\nW/System.err(16021): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)\r\n```\r\n\r\nIf I remove the `animated: true` or the `slide` transition when navigating the issue will not manifest.","author":{"url":"https://github.com/darind","@type":"Person","name":"darind"},"datePublished":"2018-04-13T08:40:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/5674/NativeScript/issues/5674"}
| 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:42597d74-c02f-b707-76ab-b729c7dc54e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C79C:9190C:1034C0E:155DF38:69741447 |
| html-safe-nonce | 16f05adf9f7d3a05bafc6a291d566dd1bdca17a4eebcff8f85d164e93296c4f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzlDOjkxOTBDOjEwMzRDMEU6MTU1REYzODo2OTc0MTQ0NyIsInZpc2l0b3JfaWQiOiIzNzQ0NjQ0Nzk3MzA2MjQ2MjE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a0e0d649f0ea70bd3fa60e4864934c05992d6a934ba4ce04f5aee0aa28b1139f |
| hovercard-subject-tag | issue:314018198 |
| 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/5674/issue_layout |
| twitter:image | https://opengraph.githubassets.com/843fd8b9629ffd104adf6b42e7ec13db3ea5213aa18ed25a7a2b080f3347e0d2/NativeScript/NativeScript/issues/5674 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/843fd8b9629ffd104adf6b42e7ec13db3ea5213aa18ed25a7a2b080f3347e0d2/NativeScript/NativeScript/issues/5674 |
| og:image:alt | Tell us about the problem An error is thrown if using slide animation during navigation Which platform(s) does your issue occur on? Android Please provide the following version numbers that your is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | darind |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| 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 | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width