My Ionic 3 project won’t build for Android any more. Serving to the browser is working. I’ve tried in numerous combinations:
- removing android platform
- updating cordova / ionic
- re-adding platform
- updating the already installed Android Studio SDK tools
- head-butting the computer
I just can’t get it to build, not even the official Ionic docs have any info. Any ideas?
Note: There are loads of outdated answers on the net that haven’t worked, so please don’t just mark this as a duplicate, as the solution needs to be up to date.
Error message in console:
ANDROID_HOME=/Users/daveshirman/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
studio
(node:16020) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
Here’s my system version info:
Davids-MBP:apphazard-app daveshirman$ ionic info
cli packages: (/Users/daveshirman/Documents/Work/AppHazard/apphazard-app/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.0.0
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.7.1
System:
ios-deploy : 1.9.2
ios-sim : 5.0.8
Node : v6.10.0
npm : 3.10.10
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro