{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/6201","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/6201/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/6201/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/6201/events","html_url":"https://github.com/NativeScript/NativeScript/issues/6201","id":352327404,"node_id":"MDU6SXNzdWUzNTIzMjc0MDQ=","number":6201,"title":"Crash on app resume: The specified child already has a parent.","user":{"login":"abhayastudios","id":1121217,"node_id":"MDQ6VXNlcjExMjEyMTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1121217?v=4","gravatar_id":"","url":"https://api.github.com/users/abhayastudios","html_url":"https://github.com/abhayastudios","followers_url":"https://api.github.com/users/abhayastudios/followers","following_url":"https://api.github.com/users/abhayastudios/following{/other_user}","gists_url":"https://api.github.com/users/abhayastudios/gists{/gist_id}","starred_url":"https://api.github.com/users/abhayastudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhayastudios/subscriptions","organizations_url":"https://api.github.com/users/abhayastudios/orgs","repos_url":"https://api.github.com/users/abhayastudios/repos","events_url":"https://api.github.com/users/abhayastudios/events{/privacy}","received_events_url":"https://api.github.com/users/abhayastudios/received_events","type":"User","site_admin":false},"labels":[{"id":809981112,"node_id":"MDU6TGFiZWw4MDk5ODExMTI=","url":"https://api.github.com/repos/NativeScript/NativeScript/labels/ns-next","name":"ns-next","color":"d93f0b","default":false},{"id":203690377,"node_id":"MDU6TGFiZWwyMDM2OTAzNzc=","url":"https://api.github.com/repos/NativeScript/NativeScript/labels/os:%20android","name":"os: android","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":{"login":"manoldonev","id":2650247,"node_id":"MDQ6VXNlcjI2NTAyNDc=","avatar_url":"https://avatars1.githubusercontent.com/u/2650247?v=4","gravatar_id":"","url":"https://api.github.com/users/manoldonev","html_url":"https://github.com/manoldonev","followers_url":"https://api.github.com/users/manoldonev/followers","following_url":"https://api.github.com/users/manoldonev/following{/other_user}","gists_url":"https://api.github.com/users/manoldonev/gists{/gist_id}","starred_url":"https://api.github.com/users/manoldonev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manoldonev/subscriptions","organizations_url":"https://api.github.com/users/manoldonev/orgs","repos_url":"https://api.github.com/users/manoldonev/repos","events_url":"https://api.github.com/users/manoldonev/events{/privacy}","received_events_url":"https://api.github.com/users/manoldonev/received_events","type":"User","site_admin":false},"assignees":[{"login":"manoldonev","id":2650247,"node_id":"MDQ6VXNlcjI2NTAyNDc=","avatar_url":"https://avatars1.githubusercontent.com/u/2650247?v=4","gravatar_id":"","url":"https://api.github.com/users/manoldonev","html_url":"https://github.com/manoldonev","followers_url":"https://api.github.com/users/manoldonev/followers","following_url":"https://api.github.com/users/manoldonev/following{/other_user}","gists_url":"https://api.github.com/users/manoldonev/gists{/gist_id}","starred_url":"https://api.github.com/users/manoldonev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manoldonev/subscriptions","organizations_url":"https://api.github.com/users/manoldonev/orgs","repos_url":"https://api.github.com/users/manoldonev/repos","events_url":"https://api.github.com/users/manoldonev/events{/privacy}","received_events_url":"https://api.github.com/users/manoldonev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2018-08-20T23:07:59Z","updated_at":"2018-12-13T21:42:23Z","closed_at":"2018-08-30T11:57:31Z","author_association":"NONE","body":"Not sure if related to #6199 (not using tabs), but I am having a serious issue where the app crashes after it comes back from being in the background: `The specified child already has a parent. You must call removeView() on the child's parent first.`\r\n\r\nThe full exception is below.\r\n```\r\nSystem.err: java.lang.RuntimeException: Unable to resume activity {com.abhayastudios.myapp/com.tns.NativeScriptActivity}: 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.app.ActivityThread.performResumeActivity(ActivityThread.java:3788)\r\nSystem.err:   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)\r\nSystem.err:   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1746)\r\nSystem.err:   at android.os.Handler.dispatchMessage(Handler.java:105)\r\nSystem.err:   at android.os.Looper.loop(Looper.java:164)\r\nSystem.err:   at android.app.ActivityThread.main(ActivityThread.java:6938)\r\nSystem.err:   at java.lang.reflect.Method.invoke(Native Method)\r\nSystem.err:   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)\r\nSystem.err:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)\r\nSystem.err: Caused by: 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.FragmentController.execPendingActions(FragmentController.java:379)\r\nSystem.err:   at android.support.v4.app.FragmentActivity.onResume(FragmentActivity.java:461)\r\nSystem.err:   at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)\r\nSystem.err:   at android.app.Activity.performResume(Activity.java:7353)\r\nSystem.err:   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763)\r\nSystem.err:   ... 8 more\r\n```\r\n\r\n### Which platform(s) does your issue occur on?\r\nAndroid\r\n\r\n### Please provide the following version numbers that your issue occurs with:\r\n- CLI: `4.2`\r\n- Cross-platform modules: `4.3.0-2018-08-17-04`\r\n- Runtime(s): `4.2`\r\n- Plugin(s): (look for the version number in the `package.json` file of your\r\nproject)\r\n\r\n### Please tell us how to recreate the issue in as much detail as possible.\r\n\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\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/447131080","html_url":"https://github.com/NativeScript/NativeScript/issues/6201#issuecomment-447131080","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/6201","id":447131080,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzEzMTA4MA==","user":{"login":"nudiref","id":30095049,"node_id":"MDQ6VXNlcjMwMDk1MDQ5","avatar_url":"https://avatars0.githubusercontent.com/u/30095049?v=4","gravatar_id":"","url":"https://api.github.com/users/nudiref","html_url":"https://github.com/nudiref","followers_url":"https://api.github.com/users/nudiref/followers","following_url":"https://api.github.com/users/nudiref/following{/other_user}","gists_url":"https://api.github.com/users/nudiref/gists{/gist_id}","starred_url":"https://api.github.com/users/nudiref/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nudiref/subscriptions","organizations_url":"https://api.github.com/users/nudiref/orgs","repos_url":"https://api.github.com/users/nudiref/repos","events_url":"https://api.github.com/users/nudiref/events{/privacy}","received_events_url":"https://api.github.com/users/nudiref/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T21:42:23Z","updated_at":"2018-12-13T21:42:23Z","author_association":"NONE","body":"​i have this bug after upgrading to NativeScript 5 as well. was anyone able to solve it?\r\n\r\nhere is my configuration:\r\n\r\nnativescript: 5.1.0\r\ntns-core-modules: next (\"^5.2.0-next-2018-12-13-170345-02\")\r\ntns-android: next (\"5.2.0-2018-12-13-170001-01\")\r\n\r\nscenario:\r\n\r\nnavigate to a page when app resumes from background.\r\nfollowing code in app.js produces the problem:\r\n\r\nvar frameModule = require('ui/frame');\r\napplication.on(application.resumeEvent, function (context) {\r\n    frameModule.topmost().navigate('./views/home/home');\r\n});\r\n\r\nerror:\r\nAn uncaught Exception occurred on \"main\" thread.\r\njava.lang.RuntimeException: Unable to resume activity {com.A2ZFieldServices.FieldCompass/com.tns.NativeScriptActivity}: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first."}}
{"actor":{"display_login":"nudiref"}}