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

Metadata for firebase-crashlytics-gradle version 3.0.0 is missing the dependencies on #5929

Closed
yogurtearl opened this issue May 3, 2024 · 9 comments

Comments

@yogurtearl
Copy link

[READ] Step 1: Are you in the right place?

yes

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 8.4.0
  • Firebase Component: firebase-crashlytics-gradle
  • Component version: 3.0.0 (was working in 2.9.9

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Create a small gradle plugin that relies on the firebase crashlytics gradle plugin (see code below)

3.0.0 seems to have added a reference to com.android.build.api.variant.ApplicationAndroidComponentsExtension
in the file com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin

but it didn't add the needed dependency in the published .pom file or the .module file.

Those files should declare dependencies on all other things that are in use.

in this case, they need to have a dependency on com.android.tools.build:gradle-api

Relevant Code:

in src/main/kotlin/firebase-crashlytics.gradle.kts

plugins {
    id("com.google.firebase.crashlytics")
}

in build.gradle.kts

plugins {
    `kotlin-dsl`
}

dependencies {
    implementation("org.apache.httpcomponents:httpclient:4.5.14")
    implementation("com.google.firebase.crashlytics:com.google.firebase.crashlytics.gradle.plugin:3.0.0")
}

Context:

This is similar to this issue: #5473

workaround

add this to the build.gradle.kts file of your plugin that depends on the firebase crashlytics plugin:

   implementation("com.android.tools.build:gradle-api:8.4.0")
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@Ma7moud3ly
Copy link

Once I have updated to firebase-crashlytics 3.0.0, I keep getting this error Circular dependency between the following tasks
I had to revert to 2.9.9 🤔

@lehcar09
Copy link

lehcar09 commented May 6, 2024

Hi @yogurtearl, thank you for reaching out and reporting the issue. I tried reproducing the issue, however, I’m having a hard time in replicating it. Is there any chance you could share an MCVE to help us investigate the issue?

You mentioned that this is similar #5473. It’s possible that the cause is similar to #5473 (comment). Let me check this with our engineer.

@lehcar09
Copy link

lehcar09 commented May 6, 2024

Once I have updated to firebase-crashlytics 3.0.0, I keep getting this error Circular dependency between the following tasks I had to revert to 2.9.9 🤔

Hi @Ma7moud3ly. The error you're experiencing is related to this issue. The fix has not been released yet as per #5925 (comment). You can try the latest changes from the pre-release build #5733.

@mrober
Copy link
Contributor

mrober commented May 6, 2024

@yogurtearl can you please explain a little bit why you setup the plugin like this? In the other issue, you mentioned a build script. But I still don't understand why you define the dependencies like this, instead of in the plugins block?

Also, what version of the Android Gradle plugin do you use? You should get a much more friendly error message with a link to documentation in it.

@yogurtearl
Copy link
Author

Using AGP 8.4.0 in this example.

If I want to create a plugin that applies the firebase crashlytics gradle plugin and does some additional config, I need to add the firebase crashlytics plugin as a dependency.

Is there a downside for firebase crashlytics gradle plugin correctly declaring all of its dependencies in the meta-data?

@rlazo
Copy link
Collaborator

rlazo commented May 15, 2024

Hey @yogurtearl we released version 3.0.1 last Monday to address your issue. Please update and confirm if it works for you. Thanks!

@Climbatize
Copy link

@rlazo I confirm it works. I was awaiting for this one but my dependency manager did not warn me about 3.0.1

The reason is I usually use the same version variable for firebase-crashlytics-buildtools and it's not matching firebase-crashlytics-gradle anymore. I guess it was a bad practice

@rlazo
Copy link
Collaborator

rlazo commented May 15, 2024

Thanks for the confirmation!

@rlazo rlazo closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants