ANDROID_HOME is not set ... but its set perfectly?

I'm pretty much at my wits end here. I'm trying to run ionic build but its giving me this error:

Error: ANDROID_HOME is not set and "android" command not in your PATH.

ANDROID_HOME, ANDROID_TOOLS, ANDROID_PLATFORM_TOOLS are all set correctly. Running android opens up the android sdk - I managed to add the android platform but why won't it do a build?