Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

cordova run android --device

Deu o seguinte erro e não sei como resolver:

λ cordova run android --device Android Studio project detected ANDROID_HOME=C:\Android JAVA_HOME=C:\Program Files\Java\jdk-10 (node:712) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater at C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\lib\check_reqs.js:370:19 at _fulfilled (C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:854:54) at self.promiseDispatch.done (C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:883:30) at Promise.promise.promiseDispatch (C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:816:13) at C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:624:44 at runSingle (C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:137:13) at flush (C:\Users\Fernando\Desktop\cenourapp\garconapp\platforms\android\cordova\node_modules\q\q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) (node:712) 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:712) [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.

2 respostas
solução!

Pela mensagem de erro, o problema ocorreu porque o Cordova queria a versão 1.8 do JDK, e a sua versão parece ser uma versão mais atualizada.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Creio que uma alternativa seria fazer o que é sugerido no link abaixo, que é instalar esta versão, e alterar as variáveis de ambiente para apontar para esta versão 1.8

https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Obrigado.