Ionic run --prod error


#1

I’m trying to run my app with --prod flag, but i’ve gotten this error:

ANDROID_HOME=/Users/username/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Subproject Path: CordovaLib
env: sh: 
No such file or directory
Error: /Users/username/Documents/projetos/myApp/platforms/android/gradlew: Command failed with exit code 127 Error output:
env: sh: No such file or directory

[ERROR] An error occurred while running cordova run android (exit code 1).

Ionic Info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3

System:

    Node : v8.6.0
    npm  : 5.3.0 
    OS   : macOS Sierra

I also tried to run without --prod flag, i tried to build the app, but all the commands failed.


#2

What exact command are you running?
What is the ionic info output in your project folder?


#3

command:

ionic cordova run android --prod

ionic info:

cli packages: (/Users/username/Documents/projetos/myAppName/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 1.3.6
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.4.2

System:

    Node  : v8.6.0
    npm   : 5.3.0 
    OS    : macOS Sierra
    Xcode : Xcode 9.0 Build version 9A235 

Misc:

    backend : pro

#4

What does that mean? Did is also fail without --prod?


#5

This is old and should be updated.


#6

It was something wrong in the PATH.
Thank you, I’ll update it