Error Gradlew with Cordova build for Android


(Yan Lan) #1

Hi,

I was recently in need of a solution for Mobile Apps dev and for many reasons I decided to work with Cordova.
But, when my first project was created, I decided to build the project as-is which worked without problems for iOS but not for Android.
In fact I’ve been spending 3 days on trying to solve this problem by myself, which has been a real fail so far.

Same error message all the time :

Here’s a copy of my PATH var (.bash_profile) :

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH
export PATH=/usr/local/mysql/bin:$PATH
export PATH="$HOME/.rbenv/bin:$PATH"

export ANT_HOME=/usr/local/opt/ant
export MAVEN_HOME=/usr/local/opt/maven
export GRADLE_HOME=/usr/local/opt/gradle
export ANDROID_HOME=/usr/local/opt/android-sdk
export ANDROID_NDK_HOME=/usr/local/opt/android-ndk
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"

export PATH=$ANT_HOME/bin:$PATH
export PATH=$MAVEN_HOME/bin:$PATH
export PATH=$GRADLE_HOME/bin:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/19.1.0:$PATH

I am working with a MacBook Pro Retina 15’ mid-2014 running macOS Sierra 10.12.2.
I have used Homebrew in order to install “andoid-sdk”, “ant”, “gradle” and “maven”.

BTW : Android Studio Build and emulator work perfectly

If someone has any idea about why this error occurs, feel free to share your solution here I’d be more than happy to give it a try.