Android Gradle works in one repo, but not others

I am trying to build some APKs for some projects I am working on. In one repo running ionic cordova build android works fine with no issues. In the other I get the "Could not find an installed version of Gradle either in Android Studio, or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio" error. Both repos are using the same paths for ANDROID_HOME and JAVA_HOME.

Any ideas?