Estou usando macOS High Sierra, tenho o Android Studio instalado e consigo rodar o aplicativo apenas se eu importar a plataforma android para o Studio. Porém quando executo o comando cordova run android apresenta o seguinte erro:
iMac-de-DANIEL:garconapp daniel$ cordova build android
Android Studio project detected
ANDROID_HOME=/Users/daniel/Documents/Alura/multiplataforma/Cordova
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
studio
(node:12389) UnhandledPromiseRejectionWarning: CordovaError: 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
at Object.module.exports.check_gradle (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/lib/check_reqs.js:150:18)
at StudioBuilder.prepEnv (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/lib/builders/StudioBuilder.js:216:23)
at Api.module.exports.run (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/lib/build.js:154:20)
at /Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/Api.js:342:43
at _fulfilled (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:624:44
at runSingle (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (/Users/daniel/Documents/Alura/multiplataforma/Cordova/garconapp/platforms/android/cordova/node_modules/q/q.js:125:13)
(node:12389) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12389) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Como eu posso solucionar isso para poder testar rapidamente as modificações no aplicativo sem ter que fazer o processo inteiro toda vez no Android Studio?
PS: Testar o iOS, contradizendo o que foi dito no curso, foi muito mais fácil.