LHLK
LHLK

Reputation: 155

ionic cordova run android --prod hangs

My ionic 3 project run OK with ionic cordova run android; however, if I added the --prod flag, i.e. ionic cordova run android --prod The process hangs without any errors. The following is where it stopped:

$ ionic cordova run android --prod
Running app-scripts build: --prod --platform android --target cordova
[23:16:47]  build prod started ...
[23:16:47]  clean started ...
[23:16:47]  clean finished in 8 ms
[23:16:47]  copy started ...
[23:16:47]  deeplinks started ...
[23:16:47]  deeplinks finished in 528 ms
[23:16:47]  ngc started ...
[23:17:01]  ngc finished in 13.21 s
[23:17:01]  preprocess started ...
[23:17:01]  preprocess finished in 1 ms
[23:17:01]  webpack started ...
[23:17:01]  copy finished in 14.49 s

IT STOPPED HERE FOREVER...

I'd retried with many times with same result. The following is my ionic info:

$ ionic info

cli packages: (C:\Users\user\AppData\Roaming\npm\node_modules)
    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0
global packages:
    cordova (Cordova CLI) : 8.0.0
local packages:
    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.1.0
    Ionic Framework    : ionic-angular 3.9.2
System:
    Android SDK Tools : 25.2.5
    Node              : v8.11.2
    npm               : 5.6.0
    OS                : Windows 10
Environment Variables:
    ANDROID_HOME : C:\Android\android-sdk
Misc:
    backend : pro

Please help! Thanks...

Upvotes: 1

Views: 879

Answers (2)

Ruan
Ruan

Reputation: 4293

Any one still having this issue, a big cause of this problem is PLUGINS

run ionic cordova plugin

And have a look at your list of plugins, and uninstall All the dodgy ones, and those you arent SURE are working by running ionic cordova plugin rm your-plugin-name

This is the problem 98% of the time.

Upvotes: 0

eduPeeth
eduPeeth

Reputation: 1868

Try command

ionic cordova build android --prod --release 

Upvotes: 1

Related Questions