Title: The specified child already has a parent (when dynamically creating Frame & Page) · Issue #6931 · NativeScript/NativeScript · GitHub
Open Graph Title: The specified child already has a parent (when dynamically creating Frame & Page) · Issue #6931 · NativeScript/NativeScript
X Title: The specified child already has a parent (when dynamically creating Frame & Page) · Issue #6931 · NativeScript/NativeScript
Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.1 Android Runtime: 5.2.1 Describe the bug Related with #6312 #6201 #6339 System.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView()...
Open Graph Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.1 Android Runtime: 5.2.1 Describe the bug Related with #6312 #6201 #6339 System.err: java.lang.IllegalStateException: The specified child already ...
X Description: Environment CLI: 5.2.0 Cross-platform modules: 5.2.1 Android Runtime: 5.2.1 Describe the bug Related with #6312 #6201 #6339 System.err: java.lang.IllegalStateException: The specified child already ...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/6931
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The specified child already has a parent (when dynamically creating Frame \u0026 Page)","articleBody":"**Environment**\r\n - CLI: 5.2.0\r\n - Cross-platform modules: 5.2.1\r\n - Android Runtime: 5.2.1\r\n\r\n**Describe the bug**\r\nRelated with #6312 #6201 #6339 \r\n```\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: \tat android.view.ViewGroup.addViewInner(ViewGroup.java:4658)\r\nSystem.err: \tat android.view.ViewGroup.addView(ViewGroup.java:4499)\r\nSystem.err: \tat android.view.ViewGroup.addView(ViewGroup.java:4439)\r\nSystem.err: \tat android.view.ViewGroup.addView(ViewGroup.java:4412)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1466)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)\r\nSystem.err: \tat android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)\r\nSystem.err: \tat android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)\r\nSystem.err: \tat android.os.Handler.handleCallback(Handler.java:751)\r\nSystem.err: \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nSystem.err: \tat android.os.Looper.loop(Looper.java:154)\r\nSystem.err: \tat android.app.ActivityThread.main(ActivityThread.java:6776)\r\nSystem.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\nSystem.err: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)\r\nSystem.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)\r\n```\r\n\r\n**To Reproduce**\r\nAfter app is opened press `Back` button to \"close\" app. Then run (resume) app again by pressing app icon.\r\n\r\n**Sample project**\r\n```\r\nimport * as app from \"tns-core-modules/application\";\r\nimport {parse} from \"tns-core-modules/ui/builder\";\r\nimport {StackLayout} from \"tns-core-modules/ui/layouts/stack-layout\";\r\nimport {Page} from \"tns-core-modules/ui/page\";\r\nimport {Frame} from \"tns-core-modules/ui/frame\";\r\n\r\nconst rootLayoutXml = `\u003cStackLayout\u003e\u003cFrame id=\"rootLayoutFrame\"/\u003e\u003c/StackLayout\u003e`;\r\nconst rootLayoutView = \u003cStackLayout\u003eparse(rootLayoutXml);\r\n\r\nconst pageXml = `\u003cPage\u003e\u003cStackLayout\u003e\u003cLabel text=\"Text\"/\u003e\u003c/StackLayout\u003e\u003c/Page\u003e`;\r\nconst pageView = \u003cPage\u003eparse(pageXml);\r\n\r\nconst rootLayoutFrame = \u003cFrame\u003erootLayoutView.getViewById(\"rootLayoutFrame\");\r\n\r\napp.run({\r\n create: () =\u003e {\r\n\r\n rootLayoutFrame.navigate({\r\n create: () =\u003e pageView\r\n });\r\n\r\n return rootLayoutView;\r\n }\r\n});\r\n```\r\n\r\n\r\n\u003cbountysource-plugin\u003e\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/70291943-the-specified-child-already-has-a-parent-when-dynamically-creating-frame-page?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github).\r\n\u003c/bountysource-plugin\u003e","author":{"url":"https://github.com/webleaf","@type":"Person","name":"webleaf"},"datePublished":"2019-02-19T16:49:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/6931/NativeScript/issues/6931"}
| 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:b3840f87-1102-3157-a830-5ca8c4c1adef |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC9A:3930F2:69B4C0:85A260:697419B4 |
| html-safe-nonce | 6ac93f7230c6f8c96e76ff6bb29925f9f11fefca2ba9b99ba8be2f0c419a85c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzlBOjM5MzBGMjo2OUI0QzA6ODVBMjYwOjY5NzQxOUI0IiwidmlzaXRvcl9pZCI6IjYyOTAyMTkwODk4NDI2NzQxMDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d99a9aec26469a309379b4daa54e7c7dd83dedc56a03d2b8f9c3cb9748a6f098 |
| hovercard-subject-tag | issue:412022336 |
| 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/6931/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0b4f49ca0a9045b017776f774da6a60491a222f7ef74aaa31eaf3207aba7242a/NativeScript/NativeScript/issues/6931 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b4f49ca0a9045b017776f774da6a60491a222f7ef74aaa31eaf3207aba7242a/NativeScript/NativeScript/issues/6931 |
| og:image:alt | Environment CLI: 5.2.0 Cross-platform modules: 5.2.1 Android Runtime: 5.2.1 Describe the bug Related with #6312 #6201 #6339 System.err: java.lang.IllegalStateException: The specified child already ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | webleaf |
| 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