Cordova in Visual Studio - Compilation Error. Does not generate apk

Asked

Viewed 123 times

-2

I’m starting in Cordova and decided to try for Visual Studio Community 2017, which I successfully installed, only the Tools Package for Apache Cordova + Android SDK, Google Emulator. So, I created a new project, blank, standard, so it doesn’t get complicated, and I tried to compile, which returns me the output below, even restarting the VS.

This is the screen with the VS installation settings:

inserir a descrição da imagem aqui

here is the screen with the output (errors):

inserir a descrição da imagem aqui

What’s wrong? What’s missing?

  • the error is exactly what is written there, is not finding the java. See if it is installed correctly and if the tbm environment variables are, for example PATH

  • @Ricardo Punctual... perfect! that was it! I installed the JDK, I ran it again and it worked. Thank you. Oh, put as an answer for me to score.

  • done. I’ve had this problem too, install too much and always something doesn’t work, either Java or CLI, or Node....

1 answer

1

As the message shows, this happens because the java when executing some command.

This happens with the installation of Apache Cordova in the Visual Studio because many things are installed beyond the java, like the nodejs for example.

To confirm that java is installed and properly added to the environment variable PATH from Windows, open a command prompt window (Windows+R and type "cmd"), and type "javac -version".

Must be the version of Java SDK installed, if it does not appear is signal that is not installed or has not been installed and configured correctly.

Download the Java SDK of the official website (here: https://www.oracle.com/technetwork/java/javase/downloads/index.html), and after installing test again the above command, and everything should work properly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.