Skip to content

The generated resource String 'default_web_client_id' is only available on the main application module, breaking modularization #294

Description

@NinoDLC

Describe the bug
The generated resource String 'default_web_client_id' is only available on the main application module, breaking modularization.

My app module depends on say login feature module. Inside login module, I handle the connection stuff.

Inside the app module, I can use getString(R.string.default_web_client_id).
Inside the login module, I can't because it's not generated for my module.

To Reproduce
Steps to reproduce the behavior:
1/ Try to implement the firebase-auth inside a library module instead of an application module
2/ Fail

Expected behavior
We should be able to modularize our application.

Desktop (please complete the following information):

  • Gradle version: 8.6
  • AGP: 8.4.0
  • Plugin name and version: google-services

Additional context
This is my setup:
build.gradle.kts (root):

plugins {
    ...
    alias(libs.plugins.googleServices) apply false
}

gradle/libs.versions.toml:

[versions]
googleServicesVersion = "4.4.1"

...

[plugins]
googleServices = { id = "com.google.gms.google-services", version.ref = "googleServicesVersion " }

app/build.gradle.kts (module):

plugins {
    ...
    alias(libs.plugins.googleServices)
}

Note: If I apply the plugin in the login/build.gradle.kts to try to generate the resource String in my module, it says The google-services Gradle plugin needs to be applied on a project with com.android.application or com.android.dynamic-feature. so either way I'm doomed 🤷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions