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: Loading app resources is slow only on Android

See original GitHub issue

Bug Report

Ionic version:

[ ] 4.x [x] 5.x

Current behavior:

When running my app on Android, the chunks are lazy loaded when they are needed, although the strategy is PreloadAllModules. First, I thought this was a problem which required me to add the Angular service worker, but with the default configuration provided by the Ionic documentation it still did not work. (On Android with capacitor, http request don’t work either so I added a fix as can be seen in the MainActivity.java).

In my app, I have multiple modules with routes (authorization module, tabs module, detail modules etc.) but when navigating from for instance the login page to a tab page the javascript chunks are loaded when starting the NavController navigateRoot. I did not expect this behavior because the modules are preloaded right?

This behavior only happens on Android. iOS works fine.

Expected behavior:

I expected smooth and fast navigation between pages on Android, similar to the speed of an iOS flavor.

Steps to reproduce:

Related code:

I created a starter template repo configured with the service worker, as I did with my real app.

Clone this repo

npm install
ng build --prod
npx cap sync && npx cap open android

# Run the application on a native device

Capacitor will print a lot of requests to get the files D/Capacitor: Handling local request: http:/localhost/**

Other information:

I got the Android service worker bugfix from here

Ionic info:

Ionic:

   Ionic CLI                     : 6.10.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.901.7
   @angular-devkit/schematics    : 9.1.7
   @angular/cli                  : 9.1.7
   @ionic/angular-toolkit        : 2.2.0
   @capacitor         : 2.1.2

Utility:

   cordova-res : not installed
   native-run  : 1.0.0

System:

   NodeJS : v13.8.0 (/usr/local/bin/node)
   npm    : 6.14.5
   OS     : macOS Catalina

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MarnickvdAcommented, Jun 9, 2020

Well, the good old turning the device off and on again worked to fix the performance issue. I still have no clue what exactly caused it. I guess this issue ticket can be closed.

0reactions
ionitron-bot[bot]commented, Jul 9, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Speed up a slow Android device - Google Support
Speed up a slow Android device. Try the steps on this page if your phone: Runs very slowly; Lags; Takes a long time...
Read more >
Bug - Extremly Slow Resources.Load() (File Read) on Android
Looking in the Profiler tells me that Resources.Load() is taking a very long time to load some scriptable objects used by two plugins...
Read more >
Top Reasons Why Your Mobile App is Slow and How to Fix it
Top Reasons Why Your Mobile App is Slow and How to Fix it · 1. Your App is Obsolete and Not Supportive ·...
Read more >
Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
Read more >
Why is my Android slow? 8 ways to troubleshoot your phone
1. Free up storage space · Open the Settings app. · Go to Storage settings or search for "storage" in the Settings search...
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