Ubuntu Android build failed Unhandled Promise Rejection Warning

Hi

I try to build an android apk running this command: ionic cordova build android --info

But it failed to build.

How can i fix it? and build an Android apk ?

These are the error messages :

lint finished in 3.09 s
ANDROID_HOME=/home/myuser/Android/Sdk

JAVA_HOME=/usr/lib/jvm/java-8-oracle

(node:10166) UnhandledPromiseRejectionWarning: Unhandled promise rejection

(rejection id: 1): Error: spawn EACCES

(node:10166) [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.

Hello,

I’m not 100% sure it’s the source of your issue, but it was for me just 3 monthes ago. An issue with Android PATH on Windows, after an update of Android SDK for Win64.

As solution, update Windows PATH environment variables, manually (add the android tools manually if needed), like below.

Capture18

Hope it helps,

1 Like

Hey @angelomrigo
I think the issue is related with your android version

try this
1.ionic cordova platform remove android
2.ionic cordova platform add android@6.2.3
1 Like

Thank you, removing and adding again make it is work.