Skip to content

Crash: View already has a parent on Android 7.0 with Split screen + pageTransitions #4015

Closed

Description

@m-abs

Please, provide the details below:

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

I can consistently reproduce the problem on my Android 7.0 emulator.

Tell us about the problem

My App crashes on Android 7.0, if I have switched page and open Android 7.0's split screen.

Which platform(s) does your issue occur on?

Android 7.0

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

  • CLI: 2.5.3
  • Cross-platform modules: 2.5.2
  • Runtime(s): tns-android@2.5.0
  • Plugin(s): none

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

  1. create an angular project with: tns create hallo-world --ng
  2. set pageTransition="slideTop" on the nsRouterLink-label in app/item/items.component.html
  3. Run the App on an Android 7.0 emulator
  4. Tap an item and tap back
  5. Hold the window-switch-button down until the split-screen comes up.
  6. The App should now have crashed with the "View already has a parent"-error.

I don't know if it's caused by the same problem, but I've seen the error many times. But I haven't been able to reproduce it, making it hard to write a proper bug report on the issue.

android7-crash-view-already-have-parent

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

I've added a test project here:
https://github.com/m-abs/ns-debugging/tree/master/crash-view-already-have-parent

Activity

  1. manijak commented on Apr 19, 2017

    @manijak

    Argh! So it's not only my app. I've been getting this a lot in the latest release of my app. (Logged in analytics).

    Running vanilla NS v2.5.2
    Core modules: v2.5.2
    Android-runtime: v2.5.0

    Didn't have to tap around: just start app, hold the "square" on first view and initiate the split-screen = crash.

  2. NickIliev commented on Apr 25, 2017

    @NickIliev
    Contributor

    Confirming this issue is reproducible with the template Angular app and pageTransition on nsRouterLink.
    Test application can be found here.

    This is probably related to how Android handles the activities on split screen and after app has been minimized and might be related to this one. In fact, if you set Developer options -> Don't keep activities option ON then the application will crash on split screen but will work on minimize. If the same options is OFF then the application will work on app minimize but will crash on the split mode.

  3. changed the title [-]Crash: View already has a parent on Android 7.0 'split screen'[/-] [+]Crash: View already has a parent on Android 7.0 with Split screen + pageTransitions[/+] on Apr 25, 2017
  4. NickIliev commented on Apr 25, 2017

    @NickIliev
    Contributor

    @m-abs, @manijak as a temporary solution in order to avoid the app crashing runtime you can disable the split screen mode for your application. TO do so all you need to do is to provide a false boolean value for android:resizeableActivity key in your AndroidManifest.xml

    e.g.

    ...
    <activity
    	android:name="com.tns.NativeScriptActivity"
    	android:label="@string/title_activity_kimera"
    	android:configChanges="keyboardHidden|orientation|screenSize"
    	android:theme="@style/LaunchScreenTheme"
    	android:resizeableActivity="false">
    
  5. added this to the milestone on May 4, 2017
  6. removed their assignment
    on May 11, 2017
  7. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    and removed on May 17, 2017
  8. NickIliev commented on May 17, 2017

    @NickIliev
    Contributor

    @m-abs, @manijak just FYI - this issue is now resolved with NativeScript 3.x.x

  9. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on May 17, 2017
  10. modified the milestones: 3.0.1, 3.1 on May 22, 2017
  11. lock commented on Aug 28, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  12. locked and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions