Build failed with an exception: ionic run android

Running on windows
The command “ionic run android” fails with gradle errors

Had this error before installing ionic (just using cordova), followed through the instructions, nothing seemed to work, but ended up re-booting and then it all worked.

After installing ionic it’s happening again.

Ionic: 2.0.0
Cordova: 6.3.1
JDK: 1.6.0_45

Any suggestions on how to fix this?

I am new to app development like this and have spent a lot of time trying to get different packages installed and fixing all the issues (not all related to ionic). Does Docker take away all the pain?