Untraceable build error

When I try to build for Android I keep getting a simple error that appears as the following:

C:\path\to\project>ionic cordova run android --verbose --debug
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] Daemon found (pid: 312)
[INFO] Running app-scripts build: --platform android --target cordova

[12:58:34]  build dev started ...
[12:58:34]  clean started ...
[12:58:34]  clean finished in 15 ms
[12:58:34]  copy started ...
[12:58:34]  transpile started ...
[12:58:39]  transpile finished in 5.02 s
[12:58:39]  preprocess started ...
[12:58:39]  deeplinks started ...
[12:58:39]  deeplinks finished in 200 ms
[12:58:39]  preprocess finished in 202 ms
[12:58:39]  webpack started ...
[12:58:40]  copy finished in 5.54 s
[12:58:50]  webpack finished in 10.64 s
[12:58:50]  sass started ...
[12:58:51]  sass finished in 1.11 s
[12:58:51]  postprocess started ...
[12:58:51]  removed unused font files
[12:58:51]  postprocess finished in 34 ms
[12:58:51]  lint started ...
[12:58:51]  build dev finished in 17.24 s
> ionic cordova prepare android
> cordova prepare android
Error: Cannot read property 'length' of undefined

[ERROR] An error occurred while running cordova prepare android (exit code 1).

I’ve tried removing and re-adding the android platform, I’ve tried switching npm versions, I’ve tried deleting node_modules and several other things and I still haven’t been able to successfully build my project. Does anyone know how I could go about resolving this issue?

Ionic info:

cli packages: (C:\path\to\project\node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.7.1


Android SDK Tools : 25.2.5
Node              : v8.6.0
npm               : 5.3.0
OS                : Windows 10


backend : legacy

What does ionic cordova requirements output?

Have you solved your problem?

Have you solved your problem? I also have the same problem

cordova requirements

Requirements check results for android:
Error: Some of requirements check failed

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
cmd: Command failed with exit code 1 Error output:
‘avdmanager’ �����ڲ����ⲿ���Ҳ���ǿ����еij���
Gradle: not installed
Cannot read property ‘length’ of undefined

type or paste code here