firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.27k stars 575 forks source link

The following Android dependencies are set to compileOnly which is not supported: com.google.j2objc:j2objc-annotations:2.8 #6232

Open shyvum opened 1 month ago

shyvum commented 1 month ago

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

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Relevant Code:

No code change

google-oss-bot commented 1 month ago

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

shyvum commented 1 month ago

we faced a very similar issue w/ androidx.media3 several weeks back. https://github.com/androidx/media/issues/1325

lehcar09 commented 1 month ago

Hi @ShivamGoyal1899, thank you for reaching out. I'm not familiar with the j2objc-annotations dependency. Per checking, Firebase Android SDK does not use the dependency j2objc-annotations.

This issue means that the Gradle build system used by Android cannot determine how to handle the annotations provided by the j2objc-annotations library within an Android project. If you're not using the latest Android Gradle plugin, I would suggest try using the latest version to see if the issue is already resolved.

To get better help, It would be best to reach out to the j2objc support team. That said, I'll be closing this issue now. Let me know if you have questions or clarifications. Thanks!

shyvum commented 1 month ago

@lehcar09 we are on latest AGP and Gradle. also the issue does not comes up while using BOM v33.1.2. it fails to compile after bumping BOM to v33.2.0 (no other code change).

shyvum commented 1 month ago

@lehcar09 this is still not working on latest BOM. can you please take a look?

cpovirk commented 1 month ago

Someone reported this to us on the Guava side in https://github.com/google/guava/issues/7397. I'm working to fix it there. Once I do so, Firebase should be able to upgrade to a new version of Guava, and the problem should go away. Sorry for the trouble.

cpovirk commented 1 month ago

I released Guava 33.3.1, which contains what I believe should be a fix. Is expect that users could eliminate the error by declaring an explicit dependency on that version, and Firebase can upgrade to that version so that anyone who then upgrades Firebase will likewise no longer see the problem. Let me know if any of that doesn't work as expected. Sorry again for the problem.

shyvum commented 1 month ago

@lehcar09 can you please bump and confirm?

lehcar09 commented 1 month ago

Thank you for sharing the insight and fix @cpovirk.

Hi @ShivamGoyal1899, I tried reproducing the issue using the Firebase BOM 33.2.0, however, I did not encounter the issue.

Can you help and see what I'm missing here?

build.gradle.kts

plugins {
    id("com.android.application") version "8.6.1" apply false
    id("com.android.library") version "8.6.1" apply false
    id("org.jetbrains.kotlin.android") version "2.0.10" apply false
    id("com.google.gms.google-services") version "4.4.2" apply false
}

app/build.gradle.kts

    implementation(platform("com.google.firebase:firebase-bom:33.2.0"))
    implementation("com.google.firebase:firebase-analytics")

Alternatively, you can try adding the new Guava dependency explicitly in your app/gradle file to override the current version. Upon Checking the Google Analytics 22.1.0 is using com.google.guava:guava:31.1-android.

dependencies {
  implementation("com.google.guava:guava:33.3.1-android")
}
google-oss-bot commented 3 weeks ago

Hey @ShivamGoyal1899. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

shyvum commented 3 weeks ago

@lehcar09 we currently use all below attached dependencies in our project.

Screenshot 2024-10-01 at 11 56 57 AM
shyvum commented 3 weeks ago

@lehcar09 also, media3 folks did bump to new guava versions and were able to resolve the issue. https://github.com/androidx/media/issues/1700

lehcar09 commented 3 weeks ago

Thank you for additional details you shared. I'm still having trouble issue in reproducing the issue. However, I'll notify our engineers about this to bump the Guava version in our SDK.

Just to note, we cannot provide any timeline on this. As a workaround for now, you can try adding the new Guava 33.3.0 dependency explicitly in your app/gradle file to override the current version.

shyvum commented 3 weeks ago

understood.