For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Create Custom Build Config Variables

Add Custom fields to

android {
    buildTypes {
        def localProperties = new Properties()
        localProperties.load(new FileInputStream(rootProject.file("local.properties")))
        
        debug {
            buildConfigField("String", "API_KEY", "\"" + localProperties['apiKey'] + "\"")
        }
        release {
            buildConfigField("String", "API_KEY", "\"" + localProperties['apiKey'] + "\"")
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

Last updated