ADFA-5337 chore(build): build without google-services.json (conditional Firebase + analytics off) - #495
Merged
luisguzman-adfa merged 2 commits intoAug 28, 2026
Conversation
…al Firebase + analytics off)
A fresh clone can't build: the com.google.gms.google-services plugin fails when
google-services.json is missing, and that file holds the real Firebase keys so it
is gitignored (not in the repo).
Apply the plugin only when the file is present, and flag AnalyticsClient off when
it isn't, so a contributor gets a working APK with analytics compiled out while
release builds drop in the real file to enable Firebase.
- controller/app/build.gradle: move google-services out of the plugins {} block and
apply it conditionally at the bottom (file("google-services.json").exists());
expose BuildConfig.ANALYTICS_ENABLED from the same check.
- AnalyticsClient: gate() and applyConsent() short-circuit when ANALYTICS_ENABLED is
false, so no path touches the uninitialized Firebase SDK (Firebase is referenced
only in this class). A harmless FirebaseInitProvider warning in logcat is expected
when building without the file; the app does not crash.
No behavior change for release builds (file present -> plugin applied, analytics on).
…ompiled out Follow-up to the conditional Firebase build: when built without google-services.json (BuildConfig.ANALYTICS_ENABLED = false) there is nothing to share, so the opt-in UI should not appear. - SettingsSubFragment: the "Share usage statistics" toggle is not added. - AboutFragment (+ fragment_about.xml): the "Share anonymous data" row + description are GONE (ids added to hide them). - WizardActivity / SetupSectionFragment: the first-run analytics enrollment prompt is skipped and the flow proceeds. No change when analytics is enabled (file present): the UI shows exactly as before.
luisguzman-adfa
deleted the
chore/ADFA-5337-build-without-google-services
branch
August 28, 2026 20:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build from a fresh clone without google-services.json.
The com.google.gms.google-services plugin fails the build when google-services.json
is absent, and that file (real Firebase keys) is gitignored — so a fresh clone can't
build until someone supplies it. This makes the file optional for local/contributor
builds while release builds keep Firebase.
(file("google-services.json").exists()), out of the plugins {} block; expose
BuildConfig.ANALYTICS_ENABLED from the same check.
code path touches the uninitialized Firebase SDK. Firebase is referenced only here,
so the two guards cover it fully.
Behavior:
runs (a harmless FirebaseInitProvider warning in logcat is expected).
Relates to ADFA-5302 (build-resilience for contributor environments).