Skip to content

Add support for com.android.library - #478

Open
mrober wants to merge 3 commits into
mainfrom
mrober/lib
Open

mrober wants to merge 3 commits into
mainfrom
mrober/lib

Conversation

@mrober

@mrober mrober commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Prior to the 4.4.0 Kotlin rewrite, the plugin could be applied to com.android.library modules. The rewrite dropped that support because the new Variant API's LibraryVariant has no applicationId, which the plugin used to select the matching client entry in the google-services.json file

This change restores library support by using the library's namespace as the package_name key instead, which is effectively the same value the legacy plugin matched on

This lets library modules generate Firebase resources without a consuming app, e.g. a library's own instrumentation tests that need to initialize Firebase, instead of forcing a throwaway app module solely to host google-services.json. Resources generated in a library merge into dependent apps with normal AGP precedence, so the app's own values always win

@mrober
mrober requested a review from rlazo October 22, 2026 13:12
@rlazo

rlazo commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Some general feedback:

  • Add a description to the PR to know why the change is necessary
  • Bump the plugin's minor version since it's a "new feature"
  • Update the README.md file to reflect the support for libraries

@mrober
mrober enabled auto-merge (squash) October 22, 2026 15:25
Comment thread google-services-plugin/build.gradle.kts Outdated
@mrober
mrober requested a review from kaibolay October 23, 2026 16:41
@mrober
mrober disabled auto-merge October 23, 2026 16:49
@mrober
mrober enabled auto-merge (squash) October 23, 2026 16:49

@kaibolay kaibolay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants