Adding version “ionic cordova platform add android@7.1.0” … after almost a day trying to get ionic 3 app to built. Thank you!!

The google() repository shortcut is only available for Gradle 4.1 and higher. Check to ensure that Circle CI is set up to use Gradle 4.1 and later, and that should resolve your issue.

Alternatively, you can directly reference the Google repository using:

maven { 
    url 'https://maven.google.com' 
}

et gradle-wrapper.properties file to:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

or higher

distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

app.gradle now looks like this

project.ext.envConfigFiles = [
        debug: ".env",
        release: ".env",
        anothercustombuild: ".env",
]


apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply plugin: "com.android.application"