Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 6.1.2
- Cross-platform modules: 6.1.1
- Android Runtime: 6.1.x
- Plugin(s): nativescript-advaced-webview@4.0.1
Describe the bug
Navigating to a page that contains BottomNavigation (or Tabs) + having nativescript-advanced-webview as a dependency (not even explicitly used/initialized) is crashing the app with:
System.err: An uncaught Exception occurred on "main" thread.
System.err: The specified child already has a parent. You must call removeView() on the child's parent first.
System.err:
System.err: StackTrace:
System.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
System.err: at android.view.ViewGroup.addViewInner(ViewGroup.java:5034)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4865)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4805)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4778)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:887)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
System.err: at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2656)
System.err: at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2610)
System.err: at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2619)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:904)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
System.err: at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
System.err: at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2076)
System.err: at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1866)
System.err: at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1821)
System.err: at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
System.err: at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:193)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
To Reproduce
Use this branch of the test app.
- Navigate to the tabs page
- press the second navigation button
- return back to the tabs page
Result: the app will crash.
If you uninstall the nativescript-advanced-webview and make clean rebuild the issue will be gone.
Sample project
https://github.com/NativeScript/login-tab-navigation-ng/tree/niliev/bottom-nav-scenario
Environment
Provide version numbers for the following components (information can be retrieved by running
tns infoin your project folder or by inspecting thepackage.jsonof the project):Describe the bug
Navigating to a page that contains
BottomNavigation(orTabs) + having nativescript-advanced-webview as a dependency (not even explicitly used/initialized) is crashing the app with:To Reproduce
Use this branch of the test app.
Result: the app will crash.
If you uninstall the nativescript-advanced-webview and make clean rebuild the issue will be gone.
Sample project
https://github.com/NativeScript/login-tab-navigation-ng/tree/niliev/bottom-nav-scenario