I do not depend on locally installed Android SDK. And until last week was able to build APKs relying completely on Ionic Cloud Services i.e. by using CLI command -
In the past, I never relied on doing this to depend on locally installed android SDKs and it worked well.
ionic platform add android
Since the beginning of this week, I am getting below error while building APKs using Ionic CLI -
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
I have tried installing latest cordova @7.0.1 npm install -g cordova npm install -g ionic cordova
and also, gradle globally npm install -g ionic gradle
I downloaded the zip file and paste the tools directory in android-sdk-linux directory instead old tools directoryâŚbut it still shows the same error to me.
If you are using ionic package this thread here is not relevant to you in any way. Search the forum for current posts about âIonic Packageâ to see solutions for your problem.
and you have to manually add the environment path in the bash_profile file. add below code in that file
export PATH=$PATH/opt/gradle/gradle-4.0/bin
be clear that you have to keep the gradle file in opt directory if you are using linuxâŚor you can give the exact path where the gradle file is storedâŚThankyouâŚ
This has solved also the problem in my case.
Iâm working in Ubuntu 16.04.3. I have an Ionic 1 project. After updating everything (node, ionic, SDK packages) to the latest ones, because I had to start an Ionic 3 project, I got the same error in the Ionic 1 project, while the Ionic 3 worked perfectly. I had already Android SDK Tools V26.1.1. After replacing the tools directory the problem was solved.
Thanks
then replae these lines in the build.gradle;
compileSdkVersion 27
// compileSdkVersion cdvCompileSdkVersion
buildToolsVersion â26.0.2â
// buildToolsVersion cdvBuildToolsVersion