Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NinoDLC opened this issue May 15, 2024 · 0 comments

Comments

@NinoDLC
Copy link

NinoDLC commented May 15, 2024

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 🤷

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

No branches or pull requests

1 participant