FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tns-core-modules + nativescript-advanced-webview + navigation is crashing the app · Issue #7901 · NativeScript/NativeScript · GitHub

Repository navigation

tns-core-modules + nativescript-advanced-webview + navigation is crashing the app #7901

Description

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

Activity

  1. changed the title [-]BottomNavigation + nativescript-advanced-webview + navigation is crashing the app[/-] [+]BottomNavigation/Tabs + nativescript-advanced-webview + navigation is crashing the app[/+] on Oct 3, 2019
  2. manoldonev commented on Oct 10, 2019

    Contributor

    nativescript-advanced-webview internally depends on fancy-advanced-webview and the latter has a dependency on androidx.appcompat:appcompat:1.1.0-rc01 in its build.gradle that is causing the problem. Currently this scenario works only with androidx.appcompat:appcompat:1.0.0.

  3. changed the title [-]BottomNavigation/Tabs + nativescript-advanced-webview + navigation is crashing the app[/-] [+]tns-core-modules + nativescript-advanced-webview + navigation is crashing the app[/+] on Oct 11, 2019
  4. removed their assignment
    on Nov 23, 2019
  5. mitch3s commented on Dec 26, 2019

    Hello, I have the same issue in an app with nativescript-material-components when routing from a page with BottomNavigation to another page and then back.

    This plugin is using androidx.appcompat:appcompat:1.1.0

    Is there any workaround aside from downgrading the appcompat dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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


      Back | FazBrowse Home | New Git URL