Skip to content

fix(android): carry google-services.json as committed, not the developer's - #151

Merged
dadachi merged 1 commit into
mainfrom
fix/android-google-services
Oct 18, 2026
Merged

dadachi merged 1 commit into
mainfrom
fix/android-google-services

Conversation

@dadachi

@dadachi dadachi commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Closes #147

What

The paid Android template commits placeholder values in app/google-services.json (the com.google.gms.google-services Gradle plugin fails the build without the file), and its AGENTS.md tells the developer to drop their real Firebase file in under git update-index --skip-worktree. copySubstrate copied the working-tree file, so every generated app shipped the template developer's Firebase project (only project_id / storage_bucket renamed) and FCM could not issue a token.

  • New CopySkipRules.committedOnly: root-relative files written as the substrate's git has them staged (git show :./<path>), never from the working tree. Not in git / not tracked → the file is left out.
  • ANDROID_SKIP_RULES.committedOnly = ["app/google-services.json"].
  • README: new "Push notifications (Firebase) in the paid Android template" section next to the RevenueCat/Sentry notes; docs/OUTPUT-CHECKLIST.md 2.3 updated.

Why the placeholder instead of omitting the file

Checked on the real paid substrate: ./gradlew :app:processDebugGoogleServices passes with the placeholder and fails with File google-services.json is missing without it. Omitting the file would fail Layer 2 build mode on every paid run. The placeholder gives exactly the template's out-of-the-box behaviour (builds, push inactive until you add your own file). A non-git substrate gets no file (nothing tells the placeholder from a real one), documented in the README.

Tests

  • Git substrate with a placeholder commit and the developer's file under skip-worktree → the copy has the placeholder; same with a plain uncommitted edit.
  • Non-git substrate → no google-services.json in the copy.
  • Both seen red before the fix. Also ran the copy against the real paid substrate: the output has the placeholder.
  • npm run ci: 162/162 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr

…per's

The paid Android template commits placeholder Firebase values in
app/google-services.json and its developer keeps their real file in the
working tree under skip-worktree. The copy took the working-tree file, so
every generated app shipped the template developer's Firebase config (with
only project_id renamed) and FCM could not issue it a token.

Add a committedOnly copy rule that writes a file as the substrate's git
has it staged, and use it for app/google-services.json. The placeholder
keeps the google-services Gradle plugin (which fails without the file)
and the Debug build happy. A non-git substrate gets no file at all.
Document it next to the RevenueCat/Sentry notes.

Closes #147

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UZJxUoubntzu7Ec7DPVfAr
@dadachi
dadachi merged commit a0dff70 into main Oct 18, 2026
1 check passed
@dadachi
dadachi deleted the fix/android-google-services branch October 18, 2026 00:22
@dadachi dadachi mentioned this pull request Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paid Android: google-services.json is copied with only project_id renamed

1 participant