Skip to content

The specified child already has a parent. You must call removeView() on the child's parent first. #561

@rakeshgirase

Description

@rakeshgirase

Please take a minute to read our NativeScript Code of Conduct before proceeding with posting issues or discussing. The purpose of this guide is to make communication and cooperation within our forums a pleasure for you and the other members.

Please, provide the details below:

Did you verify this is a real problem by searching Stack Overflow?

Yes

Tell us about the problem

Got Following exception in production. When checked, I came around an issue #128 which was closed but it seems the problem still exist.
Exception java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
android.view.ViewGroup.addViewInner (ViewGroup.java:4312)
android.view.ViewGroup.addView (ViewGroup.java:4148)
android.view.ViewGroup.addView (ViewGroup.java:4089)
android.view.ViewGroup.addView (ViewGroup.java:4062)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:985)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1148)
android.app.BackStackRecord.run (BackStackRecord.java:799)
android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:1537)
android.app.FragmentManagerImpl$1.run (FragmentManager.java:482)
android.os.Handler.handleCallback (Handler.java:742)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:157)
android.app.ActivityThread.main (ActivityThread.java:5555)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:745)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:635)

Which platform(s) does your issue occur on?

_Android
Android API: 23
Android OS: 6.0.1

Please provide the following version numbers that your issue occurs with:

Following is my key dependency from package.json
"nativescript-exit": "^1.0.1",
"nativescript-grid-view": "^3.3.2",
"nativescript-plugin-firebase": "4.2.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-social-share": "^1.5.0",
"nativescript-theme-core": "1.0.4",
"nativescript-toast": "^1.4.6",
"rxjs": "5.5.2",
"tns-core-modules": "3.4.0"

Please tell us how to recreate the issue in as much detail as possible.

I am not sure how to recreate this issue. Surprisingly, I got this exception in production.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions