How to build APK by CMD using Cordova?

0

I was reading and studying, and I was interested in using Cordova to create applications. I'm doing everything by the terminal (installation and use of Cordova). However, I'm not able to create the app's APK for testing on a mobile device.

I am putting the following command:

cordova build android

And I'm having the following result:

Android Studio project detected
ANDROID_HOME=C:\Users\Luciano Junior\AppData\Local\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.0.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com
java.net.UnknownHostException: dl.google.com

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Failed to find Build Tools revision 26.0.2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
(node:4636) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Failed to find Build Tools revision 26.0.2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s
    at ChildProcess.whenDone (C:\Users\Luciano Junior\Desktop\Workspace - Angular\test-cordova\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:4636) 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:4636) [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.

How do I proceed?

    
asked by anonymous 27.04.2018 / 02:52

0 answers