Firebase gradle plugin apply order depends on other plugins
See original GitHub issueDescribe your environment
- Android Studio version: doesn’t matter, reproducible in console
- AGP version: 7.0.2
- Firebase Component: Firebase crashlytics gradle plugin
- Component version: 2.7.1
- Google services plugin version: 4.3.10
Describe the problem
Applying com.google.firebase.crashlytics
plugin depends on some other plugins applying order.
What’s wrong?
I can’t see the source code, but seems like firebase gradle plugin eagerly calls PluginContainer
to find already applied google services
or android plugins.
This could be confusing for users and makes configuration harder on user side.
_It could be avoided by using gradle plugins.withId
/plugins.withType
API, like @LouisCAD already suggested in https://github.com/firebase/firebase-android-sdk/issues/2721#issuecomment-862574176_
Steps to reproduce:
Apply com.google.firebase.crashlytics
before either android or google services plugin.
Example of errors/warnings:
Crashlytics was applied to a project without an Android plugin. Please make sure the Crashlytics plugin is applied after the appropriate Android plugin for your project.'
. But it’s applied.Crashlytics could not find Google Services plugin task: processReleaseGoogleServices. Make sure com.google.gms.google-services is applied BEFORE com.google.firebase.crashlytics. If you are not using the Google Services plugin, you must explicitly declare googleServicesResourceRoot inputs for Crashlytics upload tasks.
but it’s applied too
Related:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:8 (4 by maintainers)
Top Results From Across the Web
What the difference in applying gradle plugin - Stack Overflow
The plugins block is the newer method of applying plugins, and they must be available in the Gradle plugin repository. The apply approach...
Read more >Sharing dependency versions between projects
A version catalog is a list of dependencies, represented as dependency coordinates, that a user can pick from when declaring dependencies in a...
Read more >Quash boring tasks with Custom Gradle Plugin. - Medium
Task Dependencies : A task can depend on other tasks. We can wire the tasks in the order which we want to run...
Read more >Gradle Sync with google services modules · Issue #36 - GitHub
`In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.0.
Read more >Manage Gradle version conflicts with resolution strategy
Can happen when two components depend on the same module but on different versions. For instance: Our project depends on Firebase Analytics —...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we’ll be updating the docs for all Firebase Gradle plugins soon!
Hi @dsvoronin thanks for reporting. I agree that this could cause unexpected issues if crashlytics plugin is out of place. With this, we’ve filed a feature request to explicitly mention in the documentation that the plugin order is important (bug#192673168). We’ll also take note of using plugins.withId. Thanks.