Skip to main content

Android setup

No manifest changes are needed. The Web client ID comes from the default_web_client_id string resource, which the app module's build.gradle.kts generates from .env:

android/app/build.gradle.kts
val env: Map<String, String> = rootProject.file("../.env").let { file ->
if (!file.isFile) return@let emptyMap()
file.readLines()
.map { it.trim() }
.filter { it.isNotEmpty() && !it.startsWith("#") && it.contains('=') }
.associate { it.substringBefore('=').trim() to it.substringAfter('=').trim() }
}

android {
defaultConfig {
resValue("string", "default_web_client_id", env["GOOGLE_WEB_CLIENT_ID"] ?: "")
}
}

The Google Services Gradle plugin generates the same resource from google-services.json; use one or the other.

Release builds​

The package ships the Credential Manager keep rules for minified release builds. No ProGuard or R8 configuration is needed in the app.

Signing keys​

The Android OAuth client is not passed to the library, but Google matches the app against it. Register the package name and the SHA-1 of every key that signs the app: debug, upload, and the Play App Signing key. See Google Cloud setup.

Next​

Quick start.