Title: [Next] Back Navigation crashing the app w/ The specified child already has a parent · Issue #1516 · NativeScript/nativescript-angular · GitHub
Open Graph Title: [Next] Back Navigation crashing the app w/ The specified child already has a parent · Issue #1516 · NativeScript/nativescript-angular
X Title: [Next] Back Navigation crashing the app w/ The specified child already has a parent · Issue #1516 · NativeScript/nativescript-angular
Description: Working with next of tns-core-modules and nativescript-angular and navigating withnsRouterLink and then back with the hardware button is causing a crash. Steps to reproduce: Use this demo branch Load the app and the initial page will loa...
Open Graph Description: Working with next of tns-core-modules and nativescript-angular and navigating withnsRouterLink and then back with the hardware button is causing a crash. Steps to reproduce: Use this demo branch Lo...
X Description: Working with next of tns-core-modules and nativescript-angular and navigating withnsRouterLink and then back with the hardware button is causing a crash. Steps to reproduce: Use this demo branch Lo...
Opengraph URL: https://github.com/NativeScript/nativescript-angular/issues/1516
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Next] Back Navigation crashing the app w/ The specified child already has a parent","articleBody":"Working with `next` of `tns-core-modules` and `nativescript-angular` and navigating with`nsRouterLink` and then back with the hardware button is causing a crash.\r\n\r\nSteps to reproduce:\r\n- Use [this demo branch ](https://github.com/NickIliev/nativescript-ng-cosmos/tree/niliev/nsrouterlink-bug)\r\n\r\n- Load the app and the initial page will load with a closed sidedrawer. [Navigation through the sidedrawer](https://github.com/NickIliev/nativescript-ng-cosmos/blob/niliev/nsrouterlink-bug/app/app.component.html#L9) and **back** (to **\"Details\"**) is working as expected. \r\n\r\n- Navigate to the same details page[ via nsRouterLink](https://github.com/NickIliev/nativescript-ng-cosmos/blob/niliev/nsrouterlink-bug/app/pages/main/main.component.html#L9) by pressing the page upper content and then navigate back and the application will crash with:\r\n```\r\nJS: NavigationEnd(id: 4, url: '/info', urlAfterRedirects: '/info/app-info')\r\nJS: NavigationEnd(id: 4, url: '/info', urlAfterRedirects: '/info/app-info')\r\nJS: Router Event: Scroll\r\nJS: Scroll(anchor: 'null', position: 'null')\r\nJS: Scroll(anchor: 'null', position: 'null')\r\nSystem.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.\r\nSystem.err: at android.view.ViewGroup.addViewInner(ViewGroup.java:5122)\r\nSystem.err: at android.view.ViewGroup.addView(ViewGroup.java:4953)\r\nSystem.err: at android.view.ViewGroup.addView(ViewGroup.java:4893)\r\nSystem.err: at android.view.ViewGroup.addView(ViewGroup.java:4866)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1425)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1750)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1819)\r\nSystem.err: at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2590)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2377)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2332)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2239)\r\nSystem.err: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)\r\n...\r\n```\r\n\r\npackage.json content using **next**\r\n```JSON\r\n \"dependencies\": {\r\n \"@angular/common\": \"~6.1.0\",\r\n \"@angular/compiler\": \"~6.1.0\",\r\n \"@angular/core\": \"~6.1.0\",\r\n \"@angular/forms\": \"~6.1.0\",\r\n \"@angular/http\": \"~6.1.0\",\r\n \"@angular/platform-browser\": \"~6.1.0\",\r\n \"@angular/platform-browser-dynamic\": \"~6.1.0\",\r\n \"@angular/router\": \"~6.1.0\",\r\n \"nativescript-angular\": \"^6.2.0-2018-09-14-01\",\r\n \"nativescript-app-center\": \"^1.0.3\",\r\n \"nativescript-cardview\": \"^3.1.1\",\r\n \"nativescript-permissions\": \"^1.2.3\",\r\n \"nativescript-plugin-firebase\": \"^6.8.1\",\r\n \"nativescript-social-share\": \"^1.5.1\",\r\n \"nativescript-theme-core\": \"^1.0.4\",\r\n \"nativescript-ui-sidedrawer\": \"^4.3.0\",\r\n \"reflect-metadata\": \"~0.1.8\",\r\n \"rxjs\": \"^6.0.0\",\r\n \"tns-core-modules\": \"^4.3.0-2018-09-14-01\",\r\n \"zone.js\": \"^0.8.26\"\r\n },\r\n \"devDependencies\": {\r\n \"@angular/compiler-cli\": \"~6.1.0\",\r\n \"@ngtools/webpack\": \"~6.2.0\",\r\n \"nativescript-dev-typescript\": \"~0.7.3\",\r\n \"nativescript-dev-webpack\": \"^0.17.0-2018-09-14-01\",\r\n \"tns-platform-declarations\": \"^4.2.0\",\r\n \"typescript\": \"~2.7.2\"\r\n },\r\n```\r\n\r\nThe above case is working as expected with official versions of nativescript-angular and tns-core-modules. The navigation also works when `routerExtensions` is used ins tead of `nsRouterLink`\r\n\r\nWorkaround\r\n```TS\r\nthis._routerExtensions.navigate(\r\n [path], {\r\n transition: {\r\n name: \"fade\",\r\n duration: 300,\r\n }\r\n }\r\n )\r\n```","author":{"url":"https://github.com/NickIliev","@type":"Person","name":"NickIliev"},"datePublished":"2018-09-14T14:05:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1516/nativescript-angular/issues/1516"}
| 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:496dd4fb-e255-e51c-10c2-7c8d38fa5c86 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89D6:321922:2BC59FF:3892E75:6974D0B6 |
| html-safe-nonce | ae9af9ee29ed34d89de0ddbd19bd52ff8a5634cdfe6cd8eeb9dad2944639c8f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUQ2OjMyMTkyMjoyQkM1OUZGOjM4OTJFNzU6Njk3NEQwQjYiLCJ2aXNpdG9yX2lkIjoiODgwODE3OTQ3ODU2MDAzNDk5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f31feb20cca380d6299562b04f5930037e7d8621ab4ea520e57957ce3ed1a15c |
| hovercard-subject-tag | issue:360319223 |
| 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-angular/1516/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd2065625c1beb75388e161ca5ef985d61940cb08226dbe71734418b55e95179/NativeScript/nativescript-angular/issues/1516 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd2065625c1beb75388e161ca5ef985d61940cb08226dbe71734418b55e95179/NativeScript/nativescript-angular/issues/1516 |
| og:image:alt | Working with next of tns-core-modules and nativescript-angular and navigating withnsRouterLink and then back with the hardware button is causing a crash. Steps to reproduce: Use this demo branch Lo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NickIliev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-angular git https://github.com/NativeScript/nativescript-angular.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 35951404 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35951404 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-angular |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width