NativeScript: Navigation is slow on Android with tns-core-modules version 2.3.0
Moved from https://github.com/NativeScript/nativescript-angular/issues/453
Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?
Yes currently there is nothing about this issue in the community channels.
Tell us about the problem
When upgrading to the latest NativeScript tns-core-modules 2.3.0 I started getting an issue where navigation on Android is really slow (it looks like the fade-in animation gets stuck).
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 2.3.0
- Cross-platform modules: 2.3.0
- Runtime(s):
"tns-android"2.3.0 and"tns-ios"2.3.0
Please tell us how to recreate the issue in as much detail as possible.
Create an app which implements navigation between different screens, at which point during the navigation the transition (on API 23 the fade-in) seams stuck. You can reproduce this by cloning the nativescript-ui-samples-angular or non Angular nativescript-ui-samples and changing the tns-core-modules version to 2.3.0 here.
Is there code involved?
Nothing custom, simply using the NativeScript navigation implementation on Android.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 16
- Comments: 46 (9 by maintainers)
Already in master branch with changes in Image module. OOM Exception should be rare if at all. Please try with @next of
tns-core-modulesandtns-core-modules-widgets.+1000?
We’re currently in the proof of concept stage trying to pick a platform and this definitely didn’t help my case for NativeScript…
Hey guys,
please attach a project that demonstrate the problem. It could be that you have different versions of modules (e.g. if you are using UI for {N} they could define older version in package.json) and CLI choose to use the older version.
Please try on clean project with @next of tns-code-modules & tns-code-modules-widgets and if you see a problem - attach the project so that we could investigate it.
Routing performance of Angular 4 + TNS 3 seems very bad, there’s lag every time I press a button and / or use the router somehow.
I tried everything I could think of, but the lag is still there, except when I use the back button.
This happens in Android and iOS (to me, at least).
@dvdbrk Do you mind opening a separate issue about your problem with more detail. This thread is quite old(since NS 2.3) and it hard to tell which of the comments are still valid.
iOS nativescript + angular 3.0 navigate to another page transition freezing for 2 seconds if navigating from page which have a big images, was ok version 2.5.2
I am loading View dynamically while navigating the page but still it take much time to navigate. I have updated latest tns module in my application but it also not working and page freeze on navigation.This issue occurring only on android device but it working fine and fast on ios devices as compare to android device. Please share solution for this if any one fixed or used in their application and do the needful.
Still getting the lag on navigation and the view which is navigated to or back is unusable for a few seconds.
I used to have some of these issues but haven’t for some time now. @bhavincb @Blah2014 You can try adding the following to your
app/package.jsonto see if you get performance improvements:Also using NativeScript-fresco improved image performance under android tremendously for me.
Hi!
It only has a background image on the login section, around 600x800px / 50kb. From there, it goes to a “home” section with a regular ListView. It’s all static for now, there’s no server connection or anything.
I’ve included the Telerik SideDrawer plugin, which has a back button, it works fine, transitions are great when opening / closing. It’s just when I go to another page that the app seems to lag: press button / wait a few milliseconds (small lag, like maybe 300ms) / it goes to the section.
Some updates on this one:
The freeze is indeed caused by the
gc()call as @deneshr found. This fix was needed to avoid memory issues when navigating between pages. The memory problem is caused by large image bitmaps which are not collected property and ultimately leads to a crash due to OutOfMemory exception.@hshristov is currently working on a solution to the memory problem (part of it in #2832) which will allow us to remove the need for a manual
gc()call.+1 We’re experiencing the same thing. Hope this will be fixed soon.
Yeah, that fixed the issue (had to downgrade TypeScript to 1.8.10 too). I was just pointing out how bad of an experience this is, especially with the majority of the sample apps being in vanilla JavaScript, so not impacted by this–I assumed it was a mistake on my part.
But thanks!