question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Android - Performance issue after scrolling

See original GitHub issue

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 2.4.6
  @capacitor/core: 2.4.6
  @capacitor/android: 2.4.6
  @capacitor/electron: 2.4.6
  @capacitor/ios: 2.4.6

Installed Dependencies:

  @capacitor/ios not installed
  @capacitor/cli 2.4.6
  @capacitor/android 2.4.6
  @capacitor/core 2.4.6
  @capacitor/electron not installed

[success] Android looking great!

Platform(s)

Android

Framework(s)

Angular, Ionic

Current Behavior

When you open the app in Android and don’t scroll, you can open a page and return back with fluid transitions. When you just scroll around a bit and open the page again und go back, the transition isn’t as fluid as in the beginning.

Expected Behavior

Always fluid navigation transitions.

Code Reproduction

Starter project with two demo pages. The home page contains some sliders and another test page has just red background to better demonstrate the issue. https://github.com/AE1NS/android-performance-issue

Other Technical Details

npm --version output: 6.14.8 node --version output: v13.8.0

Tested on: Samsung Galaxy S7 edge

Additional Context

In a more complex application we have significant performance issues with Android as also described here: https://github.com/ionic-team/capacitor/discussions/3899

Visual example

You will see it more clear on a real device, as in the low frames gif below.

Without scrolling After scrolling
Example project
20210210_084216 20210210_084318
Productive project
20210212_073250 20210212_073344

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:35 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
mitschmidtcommented, Oct 6, 2021

My team and I were having the same issues with performance on Android, while iOS was really smooth even on older devices.

We figured this was due to resources (i.e. number of DOM nodes) in combination with animations, my colleague @derbenoo found an elegant solution for our App. We plan to share our insights on our blog in the future, would that be interesting for anybody?

3reactions
AE1NScommented, Sep 29, 2021

I just used the LiveReload feature to run the app with reference to my machine. Inside the chrome browser (most recent stable), I also opened the application.

Inside the browser the app is running flawless without any problems, but inside the webview I get always huge frame drops on my Galaxy S20 (and also on a Galaxy S7 edge). (Btw: I also used the Angular dev tools profiler, and we dont have any change detection issues.). I especially see the frame drops while the ionic page animations.

When I run the app on a Pixel 4 or a 3 year old Motorola, the app is running fine. This seems to be a problem with Samsung devices. The S20 uses the same webview implementation (I see this inside the dev options in the settings) as the chrome browser. Its the latest version. Android System WebView 94.0.4606.61

Update: I installed the Android System WebView Beta and I have the same problems in 94.0.4638.16. Then I uninstalled the Android System WebView from the play store. Now with 83.0.4103.106 its running flawless …

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Android Phone scrolling problem-Carlcare
Here are the simple solutions to fix Android phone scrolling problem by yourself! You can try to update system, turn off developer options...
Read more >
Really bad scrolling/UI lag after Android 12 update - Reddit
CURRENTLY THE BUG ONLY EFFECTS US MODELS. Extremely noticeable scrolling lag in almost every app. (Including native apps like settings, ...
Read more >
Slow rendering - Android Developers
Layout performance: Frequency ... Layout is expected to happen when new content comes on screen, for example when a new item scrolls into...
Read more >
Laggy scrolling on Android - bug - Discourse Meta
The issue seems to only on Android on both view (mobile and desktop) and the PWA and browser too. It affect on the...
Read more >
Android poor scrolling performance - Stack Overflow
The problem is many nested LinearLayouts that are having to be drawn over and over. Take a look at using the hierarchyviewer for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found