question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase gradle plugin apply order depends on other plugins

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mrichardscommented, Dec 1, 2021

Yes, we’ll be updating the docs for all Firebase Gradle plugins soon!

2reactions
aguatnocommented, Oct 5, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found