Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luisumit/LaPreviaRestobar/llms.txt
Use this file to discover all available pages before exploring further.
local.properties is a standard Android convention for storing machine-specific and sensitive values that must not be checked into source control. La Previa Restobar extends this convention by reading the Firebase API key from this file at Gradle configuration time and embedding it as a BuildConfig field, making it available to the app at runtime without ever appearing in any versioned file.
What local.properties is and why it is git-ignored
The Android Gradle Plugin has always usedlocal.properties to store the path to the local Android SDK installation (sdk.dir). La Previa Restobar adds one extra property to that file: firebase.api.key. Because this value is secret, the file is listed in .gitignore — anyone who clones the repository must create their own copy before building.
A safe template is provided at the repository root as local.properties.example:
local.properties.example
How build.gradle.kts reads local.properties
At the very top of theandroid {} block in app/build.gradle.kts, Gradle loads the file into a Properties object before any build type is evaluated:
app/build.gradle.kts
if (localPropertiesFile.exists()) guard means the build will not fail when the file is absent — instead the property returns an empty string. This is intentional: CI environments provide the key through a different mechanism (see below).
How FIREBASE_API_KEY is injected as a BuildConfig field
Every build type callsbuildConfigField to embed the resolved value as a compile-time String constant:
app/build.gradle.kts
debug, staging, release). At runtime the app accesses the key through the generated class:
strings.xml entry where it could be extracted from an unsigned APK.
CI/CD: GitHub Secrets
Local developers uselocal.properties, but the GitHub Actions workflow never has access to that file — it does not exist in the repository. Two GitHub Secrets replace it in CI:
GOOGLE_SERVICES_JSON
The full JSON content of
app/google-services.json. The workflow writes this secret to disk before the build step so the Google Services plugin can find it.FIREBASE_API_KEY
The same key that goes in
local.properties (api_key → current_key inside google-services.json). The workflow writes this into local.properties so Gradle can inject it via buildConfigField.Configuring the secrets
Open your repository settings
Navigate to your repository on GitHub and click Settings in the top navigation bar.
Open the Secrets panel
In the left sidebar, select Secrets and variables → Actions, then click New repository secret.
Add GOOGLE_SERVICES_JSON
- Name:
GOOGLE_SERVICES_JSON - Secret: Open
app/google-services.jsonlocally, select all, and paste the entire JSON blob.
GitHub Secrets are masked in workflow logs — even if a step accidentally prints the value, GitHub replaces it with
***. Never hard-code either secret directly in a workflow YAML file.First-time local setup
Find your Firebase API key
Open
app/google-services.json (which you downloaded from the Firebase console — see Firebase Setup). Locate the api_key array and copy the value of current_key:Paste the key into local.properties
Open
local.properties and replace the placeholder:local.properties