New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
m-abs opened this Issue Apr 18, 2017 · 4 comments

Comments

Projects
None yet
8 participants
@m-abs
Contributor

m-abs commented Apr 18, 2017

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

@dtopuzov dtopuzov added the bug label Apr 19, 2017

@tsonevn tsonevn added the os: android label Apr 19, 2017

@manijak

This comment has been minimized.

Show comment
Hide comment
@manijak

manijak Apr 19, 2017

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.

manijak commented Apr 19, 2017

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.

@NickIliev

This comment has been minimized.

Show comment
Hide comment
@NickIliev

NickIliev Apr 25, 2017

Member

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.

Member

NickIliev commented Apr 25, 2017

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.

@NickIliev NickIliev changed the title from Crash: View already has a parent on Android 7.0 'split screen' to Crash: View already has a parent on Android 7.0 with Split screen + pageTransitions Apr 25, 2017

@NickIliev

This comment has been minimized.

Show comment
Hide comment
@NickIliev

NickIliev Apr 25, 2017

Member

@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">
Member

NickIliev commented Apr 25, 2017

@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">

@vakrilov vakrilov added this to the 3.1 TBD milestone May 4, 2017

@NickIliev NickIliev removed their assignment May 11, 2017

@hshristov hshristov added ready for test and removed backlog labels May 17, 2017

@NickIliev

This comment has been minimized.

Show comment
Hide comment
@NickIliev

NickIliev May 17, 2017

Member

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

Member

NickIliev commented May 17, 2017

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

@SvetoslavTsenov SvetoslavTsenov self-assigned this May 17, 2017

@SvetoslavTsenov SvetoslavTsenov added done and removed ready for test labels May 17, 2017

@dtopuzov dtopuzov modified the milestones: 3.0.1, 3.1 May 22, 2017

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