google / google/play-services-plugins

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

Open
#294 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Kotlin
Stars
526
Forks
167
Avg merge
7d 21h
Merged PRs (30d)
2

Description

**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 🤷

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.