Can't build Android

I started a new project.

I ran cordova platform add android

Everything good so far

I ran ionic cordova build android

Got a complaint for missing @ionic/app-scripts

I ran npm install @ionic/app-scripts@latest --save-dev

Ran ionic cordova build android again

Got a complaint for missing typescript

I ran npm install typescript --save-dev

Then I ran ionic cordova build android once more and got…

JAVA_HOME=C:\Program Files\java\jdk1.8.0_77
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not b
e reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not open cp_settings remapped class cache for 8dnxmf3hjzwno8j1dqwy42
sta (C:\Users\Me\.gradle\caches\4.1\scripts-remapped\settings_b42xjgmre82g

> Could not open cp_settings generic class cache for settings file 'C:\Use
rs\Me\Desktop\WebApps\app\platforms\android\settings.gradle' (C:\Users\Me\

> C:\Users\Me\.gradle\caches\4.1\scripts\8d
80f7f\ (The system cannot find the file specified)

* 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

(node:6920) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1
(node:6920) 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.
[ERROR] An error occurred while running cordova run android (exit code 1).

Removing the \cache file from my \.gradle directory did the trick.

1 Like