firebase / firebase-android-sdk

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

[FIAM] Campaigns not loading. #5817

Closed Stoisss closed 2 months ago

Stoisss commented 4 months ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

The app stopped receiving in-app messaging campaigns. From the logs, I can see there is a problem fetching the campaigns. Part of the log is as it follows:

2024-03-28 11:31:58.203 10627-11049 FIAM.Headless           com.xxx.yyy          I  Starting InAppMessaging runtime with Installation ID ezCgs-HGRbivkpfRXb6AcW
2024-03-28 11:32:01.290 10627-10627 FIAM.Headless           com.xxx.yyy          I  went foreground
2024-03-28 11:32:01.292 10627-10627 FIAM.Display            com.xxx.yyy          I  Binding to activity: com.xxx.yyy.office.splashScreen.SplashScreenActivity
2024-03-28 11:32:01.292 10627-10627 FIAM.Headless           com.xxx.yyy          I  Setting display event component
2024-03-28 11:32:01.312 10627-11051 FIAM.Headless           com.xxx.yyy          I  Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
2024-03-28 11:32:01.323 10627-11051 FIAM.Headless           com.xxx.yyy          I  Recoverable exception while reading cache: /data/user/0/com.xxx.yyy/files/fiam_impressions_store_file: open failed: ENOENT (No such file or directory)
2024-03-28 11:32:01.431 10627-11242 FIAM.Headless           com.xxx.yyy          I  Fetching campaigns from service.
2024-03-28 11:32:02.193 10627-11242 FIAM.Headless           com.xxx.yyy          W  Service fetch error: INTERNAL: Panic! This is a bug!

Notes:

Steps to reproduce:

Relevant Code:

[libraries] bom = { module = "com.google.firebase:firebase-bom", version.ref = "bom" } inAppMessaging = { module = "com.google.firebase:firebase-inappmessaging-display" } analytics = { module = "com.google.firebase:firebase-analytics" }

in .gradle file:
api platform(firebase.bom)
api firebase.inAppMessaging
api firebase.analytics
google-oss-bot commented 4 months ago

I found a few problems with this issue:

Stoisss commented 4 months ago

I found out that one of our dependencies was using gRPC 1.60.0 and it is not compatible with firbease IAM.

argzdev commented 3 months ago

Hey @Stoisss, thanks for reaching out. I was able to reproduce the same behavior with the error:

2024-04-02 20:01:21.210 13587-13587 FIAM.Headless           com.example.issue5817                I  Setting display event component
2024-04-02 20:01:21.211 13587-13665 FIAM.Headless           com.example.issue5817                I  Forcing fetch from service rather than cache. Test Device: true | App Fresh Install: true
2024-04-02 20:01:21.220 13587-13675 FIAM.Headless           com.example.issue5817                I  Fetching campaigns from service.
2024-04-02 20:01:21.257 13587-13675 FIAM.Headless           com.example.issue5817                W  Service fetch error: INTERNAL: Panic! This is a bug!

Upon testing, I did notice that there are a lot of duplicate classes in conflict. Could you verify if you excluded the dependencies of gRPC within FIAM like this:

implementation(platform("com.google.firebase:firebase-bom:32.8.0"))
    implementation("com.google.firebase:firebase-inappmessaging-display") {
        exclude(group = "com.google.protobuf", module = "protobuf-javalite")
        exclude(group = "com.google.firebase", module = "protolite-well-known-types")
    }

In the meantime, I'll inform our engineers and see if we can update the gRPC version being used inside FIAM.

lehcar09 commented 2 months ago

Hi @Stoisss, according to our engineers, there is an inherent issue with protobuf runtimes in java. You can't mix regular protobuf and proto-lite in the same app. In Firebase we use protolite, and therefore grpc-proto-lite.

Are you using io.grpc:grpc-protobuf-lite?

google-oss-bot commented 2 months ago

Hey @Stoisss. 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!

google-oss-bot commented 2 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@Stoisss if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.