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

BUG : Untracked Tracker on Live Events #129

Closed
1 of 3 tasks
chandrabezzo opened this issue Sep 22, 2023 · 35 comments
Closed
1 of 3 tasks

BUG : Untracked Tracker on Live Events #129

chandrabezzo opened this issue Sep 22, 2023 · 35 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@chandrabezzo
Copy link

chandrabezzo commented Sep 22, 2023

Describe the bug
Our events untracked on live events (again) on the dashboard using self-hosted rudderstack. This issue just happen when we run application on release mode.

Which platform is the issue occurring on
Is the error occurring on:

  • Android
  • iOS
  • Both Android and iOS

Expected behavior
Our events tracked on live events

Screenshoot
Screenshot 2023-09-25 at 10 41 36

To Reproduce

SDK initialisation snippet
Standard implementation like example

Framework version of the SDK
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.82.2)
[✓] Connected device (3 available)
[✓] Network resources

@chandrabezzo chandrabezzo added the bug Something isn't working label Sep 22, 2023
@desusai7
Copy link
Contributor

Hey @chandrabezzo

Can you explain more about the issue, are you seeing any errors, share more logs on what is happening when the events are fired ?

@chandrabezzo
Copy link
Author

HI @desusai7 I was updated my description issue. Untracked on live version replicated again in self hosted.

@chandrabezzo
Copy link
Author

I see at live events, only tracked on debug mode when use this version. But when we run as release version untracked on live events.

        "library": {
            "name": "com.rudderstack.android.sdk.core",
            "version": "1.19.1"
        },

@desusai7
Copy link
Contributor

@chandrabezzo, can you please share complete logs from the moment you run the app ?

@chandrabezzo
Copy link
Author

Just log from rudderstack? In the release mode from rudderstack I just get that logs @desusai7

@chandrabezzo
Copy link
Author

Maybe this issue related with proguard rules?

@chandrabezzo
Copy link
Author

@desusai7 just update, after add proguard rules on the android side. We can get events on the live event dashboard at self hosted rudderstack, but the payload provide unexpected value. For example

{
    "anonymousId": "YOUR_ANONYMOUS_ID",
    "channel": "mobile",
    "context": {
        "app": {},
        "device": {},
        "library": {},
        "locale": "YOUR_LOCALE",
        "network": {},
        "os": {},
        "screen": {},
        "timezone": "YOUR_TIMEZONE",
        "traits": {
            "b": {
                "first_name": "YOUR_FIRST_NAME"
            },
            "userId": "YOUR_USER_ID"
        },
        "userAgent": "Dalvik/2.1.0 (Linux; U; Android 13; sdk_gphone64_arm64 Build/TE1A.220922.012)"
    },
    "event": "YOUR_EVENT",
    "integrations": {
        "All": true
    },
    "messageId": "YOUR_MESSSAGE_ID",
    "originalTimestamp": "YOUR_TIMESTAMP",
    "properties": {
        YOUR_PROPERTIES
    },
    "rudderId": "YOUR_RUDDER_ID",
    "sentAt": "YOUR_SENT_AT",
    "type": "track"
}

@chandrabezzo
Copy link
Author

Refers json tracked above, I think we miss some value like app, device, library, network, os, screen, and our traits converted to b.

@desusai7
Copy link
Contributor

@chandrabezzo , can you confirm if you've added all the rules shown here ?

If not, please add everything and let us know how it goes.

@chandrabezzo
Copy link
Author

@desusai7 I have been added all the rules and json value tracked like my previous comment.

@desusai7
Copy link
Contributor

Can you set the log level to verbose and share the complete logs from the moment you launch the app ?

@chandrabezzo
Copy link
Author

chandrabezzo commented Sep 25, 2023

@desusai7 after changed to verbose, the logs contains secret information. I can't share the logs on the comments. But, FYI events sucessfully tracked with missing information.

@chandrabezzo
Copy link
Author

We upgrade the self hosted rudderstack to 1.14.1 issue still happen.

@chandrabezzo
Copy link
Author

Any significant update on 1.19.1 SDK android @desusai7 ? Because we never add proguard-rules.pro but events tracked sucessfully

1 similar comment
@chandrabezzo
Copy link
Author

Any significant update on 1.19.1 SDK android @desusai7 ? Because we never add proguard-rules.pro but events tracked sucessfully

@desusai7
Copy link
Contributor

@chandrabezzo, please share the logs on the slack, so that we can take a look and help you resolve the issue faster

@desusai7
Copy link
Contributor

We've made the SDK compatible with full proguard mode from 1.19.1 of the Android SDK.

@chandrabezzo
Copy link
Author

I see, but live events tracked impacted

@chandrabezzo
Copy link
Author

Have you test that changes on flutter with self hosted rudderstack? Because this issue replicated on latest self hosted rudderstack.

@desusai7
Copy link
Contributor

@chandrabezzo, This issue seems to be related to proguard and not with the self hosted Rudderstack. Thank you for sharing the logs over the slack, we are going through them and will keep you posted on that.

In the time being to unblock you, can you please add the below rules to your proguard file:

-keep class com.rudderstack.android.sdk.core.* { *; }
-keep class com.rudderstack.android.sdk.core.ecomm.* { *; }
-keep class com.rudderstack.android.sdk.core.util.* { *; }

@chandrabezzo
Copy link
Author

@desusai7 still issue

@desusai7
Copy link
Contributor

Let me try reproducing the issue and get back to you on the next steps.

@fabioginzel
Copy link

👋 Hello everyone,

I'd like to add that I'm experiencing the same issue with event tracking on Android when using the non-self-hosted version of RudderStack.

@chandrabezzo
Copy link
Author

Ok @desusai7 thanks for your help, please test before your publish plugin on pub.dev. Tracker to Rudderstack is important for us. I've been feeling unstable likely from Rudderstack. Thank You.

@desusai7
Copy link
Contributor

desusai7 commented Sep 26, 2023

@chandrabezzo, @fabioginzel I couldn't reproduce the exact issue, but I seem to figure out what would be causing the issue. Please try adding the below to your Proguard rules file and let us know how this goes.

-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}
-keep class * implements com.google.gson.JsonSerializer { *; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderContext { java.util.Map customContextMap; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderTraits { java.util.Map extras; }

@fabioginzel
Copy link

fabioginzel commented Sep 26, 2023

@desusai7
I created the proguard-rules.pro file in the android/app folder with this content and it worked!

@desusai7
Copy link
Contributor

We are exposing these rules as part of the Android SDK as well to ensure this kind of issue does not happen in the future. We already raised a PR for it here

@desusai7
Copy link
Contributor

@chandrabezzo, can you please add the below set of rules to your proguard file and your issue should be fixed ?

-keepclassmembers,allowobfuscation class * {
  @com.google.gson.annotations.SerializedName <fields>;
}
-keep class * implements com.google.gson.JsonSerializer { *; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderContext { java.util.Map customContextMap; }
-keepclassmembers class com.rudderstack.android.sdk.core.RudderTraits { java.util.Map extras; }

@desusai7
Copy link
Contributor

desusai7 commented Oct 4, 2023

@chandrabezzo, we've released version 1.20.0 of Rudderstack's Android SDK with the Proguard rules bundled in it. Can you please try upgrading / re-installing the Flutter SDK so that it fetches the latest version of Android SDK and then check if this issue is solved for you?

@chandrabezzo
Copy link
Author

Hi @desusai7 we can use same proguard rules value?

@desusai7
Copy link
Contributor

desusai7 commented Oct 5, 2023

Hi @chandrabezzo, you need not to use the proguard rules file anymore, we've attached the proguard rules file along with core SDK itself.

@chandrabezzo
Copy link
Author

So, @desusai7 have you published that feature for rudder_sdk_flutter with latest Android SDK?

@desusai7
Copy link
Contributor

desusai7 commented Oct 5, 2023

@chandrabezzo, we have not yet published rudder_sdk_flutter with the latest Android SDK yet, but the current latest version of rudder_sdk_flutter will be able to fetch the latest version of Android SDK as shown in the constraints here.

You should be able to get the latest version of Android SDK by re-installing the rudder_sdk_flutter for the time being to help you unblock.

However, we are already in the works to release a new version of rudder_sdk_flutter which uses at least version 1.20.0 of Android SDK.

@desusai7
Copy link
Contributor

Hey @chandrabezzo,

We've released Rudderstack Flutter SDK version 2.6.0 and this version makes sure that the Android SDK version of at least 1.20.0 is used and Android SDK version >= 1.20.0 comes with built-in pro guard rules to fix this kind of issue.

Please upgrade to version 2.6.0 of the Flutter SDK and let us know if you are having any issues.

@github-actions github-actions bot added the Stale label Dec 10, 2023
@desusai7
Copy link
Contributor

@chandrabezzo, closing this issue for now, feel free to open it back if the issue isn't resolved after upgrading to the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

3 participants