Sharifullah Sharif
Sharifullah Sharif

Reputation: 121

'ionic cordova run android' command stuck for 11 minute

I have two git branch, one is development and the other is lazy-load. I did lazy load in my lazy-load branch, but it stuck for 11 minutes after 'copy finished in 19.81 s' which case the build process too slow. The development branch which is not lazy loaded, build app normally, but it takes too much time to startup.

I want lazy-load branch should not take a long time in its build process.

Image when i run command ionic cordova run android enter image description here

When it finishes building the image. enter image description here

It seems that webpack takes 11 minutes to finish its task.

When I run the app in the development branch, which does not have any lazy load the webpack takes 34.59 s. enter image description here

Upvotes: 3

Views: 1917

Answers (1)

John Denver
John Denver

Reputation: 362

If you want to reduce the amount of work ionic has to do between builds while you're editing, try using the livereload flag. It will then only do a webpack update instead of a webpack full start and finish. This way you can make edits and test without having to run through the ~11 minute process every time.

ionic cordova run android --livereload

or

ionic serve

As for the long build time, I would need to see more of your code if this just started happening recently. However, on my project(s), when I'm building it can take over 10 minutes to build, especially when running with the --prod flag.

Also, always make sure you're on the latest of Ionic:

npm install @ionic/cloud-angular@latest --save
sudo npm update -g cordova
sudo npm update -g ionic

Upvotes: 1

Related Questions