Ionic package - Android build error


#1

Hi friends, today i send a build to package with the command:

ionic package build android

And i’m getting an error on output:

ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /opt/android-sdk/tools/templates/gradle/wrapper

A week ago it was working. (Ios builds are working)
Any suggestion?


#2

Searching for the error message in the forum will give you lots of threads where solutions were posted.


#3

Related issues In ionic package service?
Local, i can build normally…


#4

Yes, this for example:


#5

@Sujan12, solved the problem with:

cordova platform update android@6.2.3 --save

Thanks!!!


Ionic package android fails
#6

The solution did not work for me. Any other tips?

Edit: got it to work by also changing the config.xml.

Complete solution is to:

cordova platform update android@6.2.3 --save

then update ''config.xml´´

< engine name=“android” spec="~6.2.3" />