Coder Social home page Coder Social logo

rudderlabs / rudder-sdk-flutter Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 24.0 17.72 MB

Flutter SDK for RudderStack - the Customer Data Platform for Developers. Now supports Android, iOS and Web tracking!

Home Page: https://www.rudderstack.com

License: Other

Java 27.94% Ruby 7.68% Dart 47.91% Objective-C 12.93% Swift 0.21% HTML 2.33% Kotlin 0.74% Shell 0.23% JavaScript 0.04%
rudderstack flutter rudder analytics android ios open-source web

rudder-sdk-flutter's Introduction

What is Rudder?

Short answer: Rudder is an open-source Segment alternative written in Go, built for the enterprise.

Long answer: Rudder is a platform for collecting, storing and routing customer event data to dozens of tools. Rudder is open-source, can run in your cloud environment (AWS, GCP, Azure or even your data-centre) and provides a powerful transformation framework to process your event data on the fly.

Released under MIT License

This is the android package for Rudder Flutter SDK. Check Rudderstack Flutter SDK for details.

Local development setup

We use Melos monorepo tool. You can see all available commands/scripts in melos.yaml file

Add you .env file as per the .env.sample with secrets used in unit tests.

To setup locally:

dart pub global activate melos 2.9.0
melos run flutter:upgrade
melos run setup
melos run build:sdk:all

To allow firebase plugin to work in the example you will need to add the relevant files that contain secrets. Get firebase config files from a colleague or add your own at:

  • packages/example/android/app/google-services.json
  • packages/example/ios/Runner/GoogleService-Info.plist

In order to run locally the Android example you will need to either create an emulator with name Pixel_6_Pro_API_33 or alter the name in the run:example:android command.

Optionally for auto formatting source code via relevant Melos command you will need to install:

  • flutter_plugin_tools (dart pub global activate flutter_plugin_tools).
  • clang-format (can be installed via Brew on macOS).
  • swiftformat (can be installed via Brew on macOS).

rudder-sdk-flutter's People

Contributors

1abhishekpandey avatar ameypv-rudder avatar arnab-p avatar bardisg avatar chryssaaliferi avatar dependabot[bot] avatar desusai7 avatar divyasreedev avatar itsdebs avatar savy-91 avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rudder-sdk-flutter's Issues

RudderProperty usage is cumbersome

RudderProperty is effectively a wrapper of a Map.

While working with RudderStack together with other event loggers in Flutter (such as PostHog or MixPanel) one has to convert all the maps that other libraries use to RudderProperty because there is no fromMap constructor.

Example:

      final RudderProperty? properties =
          event.metadata != null && (event.metadata?.isNotEmpty ?? false)
              ? RudderProperty()
              : null;
      if (properties != null) {
        event.metadata!.forEach((String key, dynamic value) {
          properties.put(key, value);
        });
      }
      _postHog.capture(eventName: event.name, properties: event.metadata);
      _mixpanel.track(event.name, properties: event.metadata);
      _amplitude.logEvent(event.name, eventProperties: event.metadata);
      RudderClient.track(event.name, properties: properties);

Given that RudderProperty is not much more than a Map wrapper, it should have a fromMap constructor.

SDK does not send device token on app open

Hi!

I am setting up an integration with customer.io and therefore I'd like to push the device token there as well.

The issue I am having is that despite setting the device token correctly after initialization, the AppOpen event is not sent with the device token.

Here is an example of event sent by the Flutter SDK:

{
    "type": "track",
    "event": "Application Opened",
    "sentAt": "2021-11-17T15:42:38.444Z",
    "userId": "618d0ab3209c05224512062e",
    "channel": "mobile",
    "context": {
        "os": {
            "name": "Android",
            "version": "10"
        },
        "app": {
            "name": "XXX",
            "build": "1",
            "version": "0.0.2",
            "namespace": "XXX"
        },
        "device": {
            "id": "e1e5b4de53995195",
            "name": "generic_x86",
            "type": "Android",
            "model": "Android SDK built for x86",
            "manufacturer": "Google"
        },
        "locale": "it-IT",
        "screen": {
            "width": 1080,
            "height": 1794,
            "density": 420
        },
        "traits": {
            "id": "618d0ab3209c05224512062e",
            "userId": "618d0ab3209c05224512062e",
            "anonymousId": "e1e5b4de53995195"
        },
        "library": {
            "name": "com.rudderstack.android.sdk.core",
            "version": "1.0.22"
        },
        "network": {
            "wifi": true,
            "carrier": "Android",
            "cellular": true,
            "bluetooth": false
        },
        "timezone": "Europe/Rome",
        "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Android SDK built for x86 Build/QSR1.190920.001)"
    },
    "rudderId": "5f8fe880-dc6b-4ea9-8837-5950292f309a",
    "messageId": "1637163746413-2747fe7b-adfa-4e50-8b92-4088588ba91d",
    "anonymousId": "e1e5b4de53995195",
    "integrations": {
        "All": true
    },
    "originalTimestamp": "2021-11-17T15:42:26.413Z"
}

This is the subsequent event that gets sent:

{
    "type": "screen",
    "event": "/",
    "sentAt": "2021-11-17T15:42:38.444Z",
    "userId": "618d0ab3209c05224512062e",
    "channel": "mobile",
    "context": {
        "os": {
            "name": "Android",
            "version": "10"
        },
        "app": {
            "name": "XXX",
            "build": "1",
            "version": "0.0.2",
            "namespace": "XXX"
        },
        "device": {
            "id": "e1e5b4de53995195",
            "name": "generic_x86",
            "type": "Android",
            "model": "Android SDK built for x86",
            "token": "XXX",
            "manufacturer": "Google"
        },
        "locale": "it-IT",
        "screen": {
            "width": 1080,
            "height": 1794,
            "density": 420
        },
        "traits": {
            "id": "618d0ab3209c05224512062e",
            "userId": "618d0ab3209c05224512062e",
            "anonymousId": "e1e5b4de53995195"
        },
        "library": {
            "name": "com.rudderstack.android.sdk.core",
            "version": "1.0.22"
        },
        "network": {
            "wifi": true,
            "carrier": "Android",
            "cellular": true,
            "bluetooth": false
        },
        "timezone": "Europe/Rome",
        "userAgent": "Dalvik/2.1.0 (Linux; U; Android 10; Android SDK built for x86 Build/QSR1.190920.001)"
    },
    "rudderId": "5f8fe880-dc6b-4ea9-8837-5950292f309a",
    "messageId": "1637163746936-7d5938d0-48fa-431e-933e-387d3711803d",
    "properties": {
        "name": "/"
    },
    "anonymousId": "e1e5b4de53995195",
    "integrations": {
        "All": true
    },
    "originalTimestamp": "2021-11-17T15:42:26.936Z"
}

It seems to me that the Application Open event is sent before the token is set.

The documentation states:

To use this feature, you've to turn on the feature trackApplicationLifecycleEvents in your mobile SDK implementation code. Moreover, you have to register your deviceToken after initializing the SDK.

Which is what I am doing.

The problem persists after subsequent app restarts, therefore I assume that the token is not persisted by the Rudder sdk.

The additional problem is that due to the way Rudderstack integrates with Customer.io, there is no way for me to register the fcm token at a later stage as:

We register the deviceToken to Customer.io on the following Application Lifecycle Events.

Application Installed
Application Opened
Application Unistalled

It would be great if you could have a look at this as I believe it could be a bug in the Rudderstack SDK for Flutter and as a temporary solution it could also work if I could manually send the device token to Customer.io in a separate event.

Feature Request: Conditionally SDK Integration for Web

Is your feature request related to a problem? Please describe.
Clear ways to install sdk for web. When we use several write key for environments case like staging, preview, and production. If we declare directly to index.html file we can't change value conditionally every build.

Describe the solution you'd like
How about to build js file from rudderstack SDK then call the file under index.html.

Describe alternatives you've considered
Another approach to send from dart side or command line to js side like flutter base href.

<!--
    If you are serving your web app in a path other than the root, change the
    href value below to reflect the base path you are serving from.
    The path provided below has to start and end with a slash "/" in order for
    it to work correctly.
    For more details:
    * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
    This is a placeholder for base href that will be replaced by the value of
    the `--base-href` argument provided to `flutter build`.
  -->
  <base href="$FLUTTER_BASE_HREF">

Version compatibility problem Rudder-Firebase and firebase_core

Hello, everyone! πŸ‘‹
I’m facing a problem with rudder for flutter.
I’m trying to implement rudder_integration_firebase_flutter for our app.
Everything work well on Android, but not on iOS.
When I launch pod install --repo-update, I get this error πŸ‘‡:

[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
  In Podfile:
    firebase_core (from `.symlinks/plugins/firebase_core/ios`) was resolved to 2.3.0, which depends on
      Firebase/CoreOnly (= 10.2.0)

    rudder_integration_firebase_flutter (from `.symlinks/plugins/rudder_integration_firebase_flutter/ios`) was resolved to 1.0.1, which depends on
      Rudder-Firebase (= 2.0.6) was resolved to 2.0.6, which depends on
        Firebase/Analytics (~> 8.15.0) was resolved to 8.15.0, which depends on
          Firebase/Core (= 8.15.0) was resolved to 8.15.0, which depends on
            Firebase/CoreOnly (= 8.15.0)

I have tried several solutions like this solutions without success.

Rudder dependencies we use πŸ‘‡:

  rudder_sdk_flutter: ^2.2.0
  rudder_integration_firebase_flutter: ^1.0.1

Note : we use in our project the following dependencies related to firebase πŸ‘‡:

  firebase_core: ^2.3.0
  firebase_dynamic_links: ^5.0.6
  firebase_messaging: ^14.1.1
  firebase_crashlytics: ^3.0.6

Here my Flutter doctor πŸ‘‡:

[βœ“] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-arm, locale fr-CI)
    β€’ Flutter version 3.3.9 on channel stable at /Users/tseoh/fvm/versions/stable
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision b8f7f1f986 (2 weeks ago), 2022-11-23 06:43:51 +0900
    β€’ Engine revision 8f2221fbef
    β€’ Dart version 2.18.5
    β€’ DevTools version 2.15.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    β€’ Android SDK at /Users/tseoh/Library/Android/sdk
    β€’ Platform android-33, build-tools 33.0.0
    β€’ Java binary at: /Users/tseoh/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app/Contents/jre/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.0)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 14A309
    β€’ CocoaPods version 1.11.3

[βœ“] Android Studio (version 2021.3)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[βœ“] Android Studio (version 2021.3)
    β€’ Android Studio at /Users/tseoh/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/213.7172.25.2113.9123335/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[βœ“] IntelliJ IDEA Community Edition (version 2022.2.3)
    β€’ IntelliJ at /Applications/IntelliJ IDEA CE.app
    β€’ Flutter plugin version 71.0.5
    β€’ Dart plugin version 222.4345.14

[βœ“] IntelliJ IDEA Community Edition (version 2022.2.4)
    β€’ IntelliJ at /Users/tseoh/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/222.4459.24/IntelliJ IDEA CE.app
    β€’ Flutter plugin version 71.0.5
    β€’ Dart plugin version 222.4345.14

[βœ“] IntelliJ IDEA Community Edition (version 2022.3)
    β€’ IntelliJ at /Users/tseoh/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/223.7571.182/IntelliJ IDEA CE.app
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart

[!] Connected device
    ! No devices available

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available

! Doctor found issues in 1 category.

builder.withLogLevel & recordScreenViews not working on v2.1.1

Am I crazy or the RudderLogger implementation is not being used atm? I don't see anything on the console(should I?) whether I use RudderLogger.init(RudderLogger.DEBUG) or builder.withLogLevel(RudderLogger.DEBUG) to initialize it.

On another note, correct me if I'm wrong but the recordScreenViews property is sending the native SDK screen views which for Flutter are not very useful, do we have to implement our own navigation observer and send screen events manually? am I missing something?

--EDIT--

Also using builder.withDebug(true) jic

AnonymousId inconsistence - Flutter app

When we are setting a new anonymousId (RudderClient?.putAnonymousId(uuid.v4());), this is not comming with the same id into the traits properties. Here is an example:

{
    "type": "track",
    "event": "test_event",
    "sentAt": "2021-12-06T17:36:26.362Z",
    "userId": "123",
    "channel": "mobile",
    "context": {
        "os": {
            "name": "iOS",
            "version": "15.0"
        },
        "app": {
            "name": "",
            "build": "1",
            "version": "0.0.1",
            "namespace": ""
        },
        "device": {
            "id": "305a60e5-b812-4247-8497-e2053fe6d1d3",
            "name": "iPhone 13 Pro",
            "type": "iOS",
            "model": "iPhone",
            "manufacturer": "Apple",
            "attTrackingStatus": 0
        },
        "locale": "en-(null)",
        "screen": {
            "width": 844,
            "height": 390,
            "density": 3
        },
        "traits": {
            "userId": "123",
            "anonymousId": "305a60e5-b812-4247-8497-e2053fe6d1d3"
        },
        "library": {
            "name": "rudder-ios-library",
            "version": "1.2.1"
        },
        "network": {
            "wifi": true,
            "carrier": "unavailable",
            "cellular": false,
            "bluetooth": false
        },
        "timezone": "America/Sao_Paulo"
    },
    "rudderId": "d8804eec-c576-4ba1-a4fc-0bfb3e08ea4c",
    "messageId": "1638812182-28a34755-eced-4fac-b22b-8bec3a335ea7",
    "properties": {
        "device": "appIos",
        "creatorId": "123"
    },
    "anonymousId": "8155a76c-5740-4cd6-80ce-e16283935b03",
    "integrations": {
        "All": true
    },
    "originalTimestamp": "2021-12-06T17:36:22.845Z"
}

Missing named parameter `clearAnonymousId` on reset

Describe the bug

Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
: Error: No named parameter with the name 'clearAnonymousId'.
RudderController.dart:47
    RudderSdkPlatform.instance.reset(clearAnonymousId: clearAnonymousId);
                                     ^^^^^^^^^^^^^^^^

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

  • Android
  • iOS
  • Both Android and iOS

Expected behavior
Can run application

To Reproduce
Run application with rudder_sdk_flutter version 2.5.0

Version of the Flutter 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.0)
[βœ“] Connected device (4 available)
! Error: SHDA0085 is busy: Making SHDA0085 ready for development. Xcode will continue when SHDA0085 is finished. (code -10)
[βœ“] Network resources

BUG : Extra "b." Prefix Added to Custom

Description:
After upgrading to rudder_sdk_flutter: ^2.5.1, I've noticed that when using the traits.put method to set custom traits, an additional "b." prefix is prepended to the trait keys.

Steps to Reproduce:

  1. Install rudder_sdk_flutter: ^2.5.1.
  2. Implement the following code snippet:
traits.put('cpf', user.cpf ?? '');

BUG : Untracked Tracker on Live Events

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

BUG : Incompatibility with flutter_localizations on Flutter 3.10.0

Hello,

After upgrading to flutter 3.10.0, there is incompatibility between the rudder_sdk_flutter_platform_interface and flutter_localizations because they depend on different versions of intl package.

This is the error I'm seeing when I build the project:

Because every version of flutter_localizations from sdk depends on intl 0.18.0 and every version of rudder_sdk_flutter_platform_interface depends on intl ^0.17.0, flutter_localizations from sdk is incompatible with
  rudder_sdk_flutter_platform_interface.

I have the latest version(2.3.1) of rudder_sdk_flutter installed.

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22621.1702], locale en-US)
[βœ“] Windows Version (Installed version of Windows is version 10 or higher)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[βœ“] Chrome - develop for the web
[βœ“] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.4)
[βœ“] Android Studio (version 2022.1)
[βœ“] VS Code (version 1.78.1)
[βœ“] Connected device (4 available)
[βœ“] Network resources

β€’ No issues found!

BUG : anonymousId is not defaulting to deviceId

Describe the bug
Please provide the following information:

According to the documentation AnonymousId should be device id putAnonymousId is called.
However using the code provided bellow, the anonymousId is different from the deviceId.

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

  • Android
  • iOS
  • Both Android and iOS

Expected behavior
anonymousId is a 16 number digit and the same as deviceId

To Reproduce
Use the following class and init on the start of the app.

class RudderStackAnalyticsProvider extends IAnalyticsProvider {
  RudderStackAnalyticsProvider(this._environmentType, this._writeKey);

  final String _writeKey;
  final EnvironmentType _environmentType;
  final RudderController _client = RudderController.instance;
  String _userId = 'user';

  @override
  Future<void> init() async {
    RudderLogger.init(
      _environmentType == EnvironmentType.development
          ? RudderLogger.DEBUG
          : RudderLogger.VERBOSE,
    );
    final builder = RudderConfigBuilder()
      ..withDataPlaneUrl('https://mindmanukih.dataplane.rudderstack.com')
      // https://github.com/rudderlabs/rudder-sdk-flutter/issues/37#issuecomment-999316787
      ..withMobileConfig(
        MobileConfig(
          autoCollectAdvertId: true,
        ),
      )
      ..withDebug(false); // Set to true for verbose logs from RudderStack

    _client.initialize(
      _writeKey,
      config: builder.build(),
    );
  }

  @override
  Future<void> logEvent({
    required String eventName,
    Map<String, dynamic>? parameters,
  }) async {
    final properties = RudderProperty();
    parameters?.forEach(properties.put);

    _client.track(eventName, properties: properties);
  }

  @override
  Future<void> flush() async {}

  @override
  Future<void> reset() async {
    _client.reset();
  }

  @override
  Future<void> updateUserId(String? userId) async {
    if (_userId == userId) {
      return;
    } else if (userId != null) {
      _userId = userId;
      _client.identify(userId);
    } else {
      _userId = 'user';
      _client
        ..identify('user')
        ..reset();
    }
  }

  @override
  Future<void> addTraits(Map<String, Object?> traits) async {
    final rudderTraits = RudderTraits();
    traits.forEach(rudderTraits.put);
    _client.identify(_userId, traits: rudderTraits);
  }
}

Version of the Flutter SDK
Please provide the following information:

rudder_sdk_flutter: ^2.6.0

SDK initialisation snippet
provided above

Framework version of the SDK
Flutter 3.13.3
Dart 3.1.1

getInstance does not return an instance

The static void method getInstance of RudderClient does not return an instance.

In order to improve code quality it would be better to rename it to inizialize or to change the RudderClient implementation to Singleton instead of a static class.

e.g.

class RudderClient {
  RudderClient._();
  static final RudderClient _instance = RudderClient._();
  static RudderClient get instance => _instance;

  final _platformChannel = const MethodChannel('rudder_sdk_flutter');

  void initialize(String writeKey,
      {RudderConfig? config, RudderOption? options}) {
    config ??= RudderConfig();
    Map<String, dynamic> params = {};
    params['writeKey'] = writeKey;
    params['config'] = config.toMap();
    if (options != null) {
      params['options'] = options.toMap();
    }
    _platformChannel.invokeMethod("initializeSDK", params);
  }

BUG : Self Hosted Rudderstack Response 400 and Error Invalid JSON

Describe the bug
We have self hosted rudderstack in our company. Then, set flutter plugin to the latest version on rudder_sdk_flutter: ^2.4.1. I got an error

E/RudderSDK( 8304): Error: RudderNetworkManager: sendNetworkRequest: Request to endpoint {YOUR_DATA_PLANE_URL} failed with status code 400 and error Invalid JSON

But after some research this issue solved when you use this specific version

  rudder_plugin_android: 2.2.2
  rudder_plugin_ios: 2.2.2
  rudder_plugin_web: 2.2.3
  rudder_sdk_flutter_platform_interface: 2.3.1

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

  • Android
  • iOS
  • Both Android and iOS

Expected behavior
Tracked an event on live events

To Reproduce
Running the app with active/enable write key

Screenshots
If applicable, add screenshots to help explain your problem.

Version of the Flutter 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.81.1)
[βœ“] Connected device (3 available)
[βœ“] Network resources

SDK initialisation snippet
Follow documentation

Framework version of the SDK
Flutter 3.10.6

Check for Correct Usage of writeKey and dataPlaneUrl
Used active writeKey and correct dataPlaneUrl

mistakes in your documentation

your code is wrong in Readme.md

Initialize RudderClient

this is a bit better

RudderConfigBuilder builder = RudderConfigBuilder();
builder.withDataPlaneUrl("https://rudderstacgwyx.dataplane.rudderstack.com");
builder.withControlPlaneUrl("https://api.rudderlabs.com");
builder.withLogLevel(RudderLogger.VERBOSE);
RudderOption options = RudderOption();
options.putIntegration("Amplitude", true);
const String writeKey = "write_key";
rudderClient.initialize(writeKey, config: builder.build(), options: options);

image

Android builds broken due to android SDK change

Incorrect use of semantic versioning and lack of version pinning has broken all Flutter on Android builds that use this library.

Caused by this commit with breaking changes: rudderlabs/rudder-sdk-android@8bde3a2

Error:

/home/.pub-cache/hosted/pub.dartlang.org/rudder_sdk_flutter-1.0.7/android/src/main/java/com/rudderstack/sdk/flutter/RudderSdkFlutterPlugin.java:211: error: cannot find symbol
                RudderClient.updateWithAdvertisingId(
                            ^
  symbol:   method updateWithAdvertisingId(String)
  location: class RudderClient
/home/.pub-cache/hosted/pub.dartlang.org/rudder_sdk_flutter-1.0.7/android/src/main/java/com/rudderstack/sdk/flutter/RudderSdkFlutterPlugin.java:221: error: cannot find symbol
                RudderClient.setAnonymousId((String) argumentsMap.get("anonymousId"));
                            ^
  symbol:   method setAnonymousId(String)
  location: class RudderClient

BUG : The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (Rudder-Firebase)

Bug description
Getting The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (Rudder-Firebase) when running pod install.

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

  • Android
  • iOS
  • Both Android and iOS

To Reproduce
Steps to reproduce the behaviour:

  1. Add the package rudder_integration_firebase_flutter: ^2.0.6 to pubspec.yaml & run flutter pub get
  2. run: pod install in the ios directory
  3. See the error:
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure again.
firebase_crashlytics: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
firebase_performance: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '10.10.0' defined in 'firebase_core'
Downloading dependencies
Installing AppAuth (1.6.2)
Installing AppsFlyerFramework (6.10.1)
Installing BoringSSL-GRPC (0.0.24)
Installing FMDB (2.7.5)
Installing Firebase (10.10.0)
Installing FirebaseABTesting (10.13.0)
Installing FirebaseAnalytics (10.3.0)
Installing FirebaseCore (10.10.0)
Installing FirebaseCoreExtension (10.13.0)
Installing FirebaseCoreInternal (10.13.0)
Installing FirebaseCrashlytics (10.10.0)
Installing FirebaseFirestore (10.10.0)
Installing FirebaseInstallations (10.13.0)
Installing FirebaseMessaging (10.10.0)
Installing FirebasePerformance (10.10.0)
Installing FirebaseRemoteConfig (10.10.0)
Installing FirebaseSessions (10.13.0)
Installing Flutter (1.0.0)
Installing GTMAppAuth (1.3.1)
Installing GTMSessionFetcher (2.3.0)
Installing GoogleAppMeasurement (10.3.0)
Installing GoogleDataTransport (9.2.5)
Installing GoogleSignIn (6.2.4)
Installing GoogleUtilities (7.11.5)
Installing MetricsReporter (1.0.0)
Installing OrderedSet (5.0.0)
Installing PromisesObjC (2.3.1)
Installing PromisesSwift (2.3.1)
Installing ReachabilitySwift (5.0.0)
Installing Rudder (1.18.0)
Installing Rudder-Firebase (3.0.0)
Installing RudderKit (1.4.0)
Installing SAMKeychain (1.5.3)
Installing Toast (4.0.0)
Installing abseil (1.20220623.0)
Installing appsflyer_sdk (6.8.0)
Installing assets_audio_player (0.0.1)
Installing assets_audio_player_web (0.0.1)
Installing better_open_file (0.0.1)
Installing biometric_storage (0.0.1)
Installing cloud_firestore (4.8.2)
Installing connectivity_plus (0.0.1)
Installing device_info_plus (0.0.1)
Installing firebase_core (2.14.0)
Installing firebase_crashlytics (3.3.3)
Installing firebase_messaging (14.6.3)
Installing firebase_performance (0.9.2-3)
Installing firebase_remote_config (4.2.3)
Installing flutter_custom_tabs (0.0.1)
Installing flutter_fgbg (0.0.1)
Installing flutter_inappwebview (0.0.1)
Installing flutter_local_notifications (0.0.1)
Installing flutter_secure_storage (6.0.0)
Installing flutter_udid (0.0.1)
Installing fluttertoast (0.0.2)
Installing gRPC-C++ (1.50.1)
Installing gRPC-Core (1.50.1)
Installing google_sign_in_ios (0.0.1)
Installing in_app_review (0.2.0)
Installing leveldb-library (1.22.2)
Installing local_auth_ios (0.0.1)
Installing nanopb (2.30909.0)
Installing otp_autofill (0.0.1)
Installing package_info_plus (0.4.5)
Installing path_provider_foundation (0.0.1)
Installing razorpay-pod (1.3.3)
Installing razorpay_flutter (1.1.10)
Installing rudder_integration_firebase_flutter (2.0.0)
Installing rudder_plugin_ios (0.0.1)
Installing share_plus (0.0.1)
Installing shared_preferences_foundation (0.0.1)
Installing sqflite (0.0.3)
Installing store_redirect (0.0.1)
Installing uni_links (0.0.1)
Installing url_launcher_ios (0.0.1)
Installing video_player_avfoundation (0.0.1)
Installing webview_flutter_wkwebview (0.0.1)
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (Rudder-Firebase)

Version of the Flutter SDK

  1. The version of the Rudder Flutter SDK you are using: rudder_sdk_flutter: 2.4.1
  2. If you are utilizing Flutter device mode integration, kindly provide:
    • The name and version of the device mode integration: rudder_integration_firebase_flutter: ^2.0.6

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 3.10.6, on macOS 13.0 22A380 darwin-arm64, locale en-IN)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[βœ“] Xcode - develop for iOS and macOS (Xcode 14.3)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2021.1)
[βœ“] VS Code (version 1.81.0)
[βœ“] Connected device (3 available)
[βœ“] Network resources

β€’ No issues found!

BUG : "RSDBPersistentManager: saveEvent: SQLite Command Preparation Failed" on iOS SDK 14

Describe the bug

We are running into an issue where all events are not being fired for iOS devices with iOS SDK 14, after updating to the latest iOS/Flutter SDKs. Events fire fine on iOS SDKs >= 15.

I am able to repro this on a iOS 14.5 simulator, and looking at the logs I see:
[logging] near "RETURNING": syntax error in "INSERT INTO events (message, updated) VALUES ([redacted]) RETURNING id;"

And debugging into the Rudder SDK I am seeing us hit the error in RSDBPersistentManager.m:
@"RSDBPersistentManager: saveEvent: SQLite Command Preparation Failed"

I see these just on iOS 14 with these new SDKs, I assume they are relevant to the events not showing up on the backend.

I am seeing this when I update our Flutter SDKs
rudder_sdk_flutter: ^2.3.0 -> ^2.5.1
rudder_sdk_flutter_platform_interface: ^2.3.0 -> ^2.5.0

but I'm guessing the real reason is the native iOS SDK being updated:
Rudder (1.19.2) -> (1.20.0)

I have seen some noise in commits recently concerning db encryption issues recently which may be relevant?

Here is an example stack where I am hitting the saveEvent error:
#0 0x000000010309f1a0 in -[RSDBPersistentManager saveEvent:] at .../ios/Pods/Rudder/Sources/Classes/RSDBPersistentManager.m:334
#1 0x00000001030afbdc in -[RSEventRepository dump:] at .../ios/Pods/Rudder/Sources/Classes/RSEventRepository.m:242
#2 0x00000001030924f0 in -[RSClient dumpInternal:type:] at .../ios/Pods/Rudder/Sources/Classes/RSClient.m:75
#3 0x00000001030927d0 in -[RSClient track:properties:] at .../ios/Pods/Rudder/Sources/Classes/RSClient.m:105
#4 0x0000000103090a70 in -[RSApplicationLifeCycleManager sendApplicationOpenedWithProperties:] at .../ios/Pods/Rudder/Sources/Classes/RSApplicationLifeCycleManager.m:152
#5 0x00000001030909a8 in -[RSApplicationLifeCycleManager sendApplicationOpenedOnLaunch:withVersion:] at .../ios/Pods/Rudder/Sources/Classes/RSApplicationLifeCycleManager.m:147
#6 0x0000000103090548 in -[RSApplicationLifeCycleManager applicationDidFinishLaunchingWithOptions:] at .../ios/Pods/Rudder/Sources/Classes/RSApplicationLifeCycleManager.m:110
#7 0x0000000103090010 in -[RSApplicationLifeCycleManager handleAppStateNotification:] at .../ios/Pods/Rudder/Sources/Classes/RSApplicationLifeCycleManager.m:44

Which platform is the issue occurring on

  • Android
  • [ x] iOS
  • Both Android and iOS

Expected behavior
Events to fire on iOS SDK 14

To Reproduce
Steps to reproduce the behaviour:

  1. Initialise latest Flutter SDK on iOS 14.5 simulator
  2. Make events '....'
  3. See the error

Version of the Flutter SDK
rudder_sdk_flutter: ^2.5.1
rudder_sdk_flutter_platform_interface: ^2.5.0
Rudder: (1.20.0)

Framework version of the SDK
Flutter Doctor output
[βœ“] Flutter (Channel stable, 3.13.3, on macOS 13.5.2 22G91 darwin-arm64, locale en-US)
[βœ“] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[βœ“] Chrome - develop for the web
[βœ“] VS Code (version 1.82.2)
[βœ“] Connected device (5 available)
[βœ“] Network resources

Check for Correct Usage of writeKey and dataPlaneUrl
I have confirmed that the correct writeKey and dataPlaneUrl are utilized during SDK initialization; they work on other platforms and previous SDKs

BUG : Application Opened & Application Backgrounded on Android device is not tracked

Describe the bug

  • Application Opened & Application Backgrounded ion Android device is not tracked.
  • When debugging on android device, I check that when the application is running in the background or open, the runnableTasks is run again before the initialization is complete, it makes the calculation results not as expected.

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

  • Android

BUG : GroupTraits do not support PostHog's required groupType field

Describe the bug
Please provide the following information:

  1. Following the integration outlined here: https://www.rudderstack.com/docs/destinations/streaming-destinations/posthog/posthog-cloud-mode/#updated-group-mapping
  2. It's currently not possible to specify a group type for PostHog group events when using the rudder-sdk-flutter package due to the limitations of the RudderTraits model.

Which platform is the issue occurring on

  • Web, Android and iOS

Expected behavior
Either RudderStack will promote traits in the extra property, or the RudderTraits model has the ability to set arbitrary values which don't live in the extra field. I tested locally and setting it outside of the extra field works as expected.

To Reproduce
Steps to reproduce the behaviour:

  1. Initialise Flutter SDK
  2. Send a group event like so:
RudderTraits groupTraits = RudderTraits();
groupTraits.put("groupType", "organization");
groupTraits.put("name", "My Org");
RudderController.instance.group('my-org, groupTraits: groupTraits);
  1. See this event gets fired, but with the groupType key contained within the extras key:
    image
  2. Observe within RudderStack cloud, this event gets forwarded to PostHog, but without the necessary "$group_type" field and therefor doesn't work:
{
    "body": {
        "XML": {},
        "FORM": {},
        "JSON": {
            "type": "group",
            "event": "$groupidentify",
            "api_key": "",
            "messageId": "831c3d0b-336a-4e22-8740-2170babf46a3",
            "timestamp": "2023-07-21T23:06:28.508Z",
            "properties": {
                "$ip": "",
                "$os": "Mac OS",
                "$lib": "RudderLabs JavaScript SDK",
                "$set": {},
                "$host": "localhost:65303",
                "$time": "2023-07-21T23:06:28.508Z",
                "$locale": "en-US",
                "$browser": "Chrome",
                "$app_name": "RudderLabs JavaScript SDK",
                "$pathname": "/",
                "$group_key": "my-org",
                "$group_set": {
                    "extras": {
                        "name": "My Org",
                        "groupType": "organization",
                    }
                },
                "$timestamp": "2023-07-21T23:06:28.508Z",
                "$useragent": "",
                "distinct_id": "9f58fbfb-c0b5-4bd2-8580-1c5d46fc37d8",
                "$app_version": "1.33.0",
                "$current_url": "http://localhost:65303/",
                "$lib_version": "1.33.0",
                "$screen_width": 2560,
                "$app_namespace": "com.rudderlabs.javascript",
                "$screen_height": 1440,
                "$screen_density": 1,
                "$browser_version": "114.0.0.0",
                "$anon_distinct_id": "9f58fbfb-c0b5-4bd2-8580-1c5d46fc37d8"
            },
            "distinct_id": "9f58fbfb-c0b5-4bd2-8580-1c5d46fc37d8"
        },
        "JSON_ARRAY": {}
    },
    "type": "REST",
    "files": {},
    "method": "POST",
    "params": {},
    "userId": "",
    "headers": {
        "Content-Type": "application/json"
    },
    "version": "1",
    "endpoint": "https://app.posthog.com/batch"
}

Screenshots
If applicable, add screenshots to help explain your problem.

Version of the Flutter SDK
Please provide the following information:

  1. The version of the Rudder Flutter SDK you are using (Rudder Flutter SDK v2.3.0)
  2. The versions of the Rudder Android and iOS SDKs utilized within Flutter (e.g., Rudder Android SDK v2.3.0 and Rudder iOS SDK v2.3.0)

SDK initialisation snippet

final RudderController controller = RudderController.instance;
    RudderLogger.init(RudderLogger.VERBOSE);
    RudderConfigBuilder builder = RudderConfigBuilder();
    builder.withDataPlaneUrl("https://{tenant}.dataplane.rudderstack.com");
    builder.withMobileConfig(MobileConfig(recordScreenViews: true));
    controller.initialize("{API_KEY}",
        config: builder.build());

BUG : Can't use session recording on Web environment

Describe the bug
Please provide the following information:

  1. I want to use session record from PostHog on a Web environment.

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

  • Web

Expected behavior
Should send session record to postHog without any setting (at-least on web env).

To Reproduce
Steps to reproduce the behaviour:

  1. Initialise Flutter SDK on web env
  2. Make some events
  3. No session record send to posthog.

Version of the Flutter SDK
Please provide the following information:

  1. The version of the Rudder Flutter SDK you are using (e.g., Rudder Flutter SDK v1.0.0)
    • rudder_sdk_flutter: ^2.8.0

SDK initialisation snippet
Share the code snippet used for initializing the Flutter SDK.

We use our own dataplaneurl and our own destSDKBaseURL.

  _rudderController = RudderController.instance;
 final RudderConfigBuilder builder = RudderConfigBuilder();
    builder.withDataPlaneUrl('URL');
    builder.withControlPlaneUrl('URL');
    builder.withLogLevel(RudderLogger.NONE);
    builder.withWebConfig(
      WebConfig(
        destSDKBaseURL: 'URL',
      ),
    );
    _rudderController?.initialize(
      dotenv.env['RUDDERSTACK_WRITE_KEY']!,
      config: builder.build(),
    );

Framework version of the SDK

➜  pia_narrative git:(main) βœ— flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 3.16.7, on macOS 14.0 23A344 darwin-arm64, locale en-FR)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[βœ“] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2022.1)
[βœ“] VS Code (version 1.85.2)
[βœ“] Network resources

β€’ No issues found!

Check for Correct Usage of writeKey and dataPlaneUrl
It work when send simple event. But not session record.

Feature Request: Upgrade rudder_plugin_web to use js ^0.7.1

I am not able to use the latest location package version as it depends on a newer Js version.

Describe the solution you'd like
Kindly update the rudder_plugin_web to use js ^0.7.1 or higher

Additional context
` [feature\home] flutter pub get --no-example
Resolving dependencies...
Because location >=6.0.0 depends on location_web ^5.0.0 which depends on js ^0.7.1, location >=6.0.0 requires js ^0.7.1.
Because rudder_plugin_web 2.6.0 depends on js ^0.6.3 and no versions of rudder_plugin_web match >2.6.0 <3.0.0, rudder_plugin_web ^2.6.0 requires js ^0.6.3.
Thus, location >=6.0.0 is incompatible with rudder_plugin_web ^2.6.0.
And because rudder_sdk_flutter 2.9.0 depends on rudder_plugin_web ^2.6.0, location >=6.0.0 is incompatible with rudder_sdk_flutter 2.9.0.
Because every version of common from path depends on rudder_sdk_flutter ^2.9.0 and no versions of rudder_sdk_flutter match >2.9.0 <3.0.0, every version of common from path requires rudder_sdk_flutter 2.9.0.
Thus, location >=6.0.0 is incompatible with common from path.
So, because home depends on both common from path and location ^6.0.0, version solving failed.

You can try the following suggestion to make the pubspec resolve:

  • Consider downgrading your constraint on location: flutter pub add location:^5.0.3
    exit code 1 `

Application Installed is not tracked

Looking at the code, at least for iOS I can see that this line is in charge of monitoring lifecycle events, but it is called too late in the process, so the application has already been launched so it never sees the launch event and hence it never tracks app installs.

Rudderstack error in android release version

Hi, I've got this error whenever I try to minimize the app (press home button in Android). After that when I back to my app, the app will restart to the beginning.

This error only happened in release build though, in debug mode the app is working fine.

rudder_sdk_flutter: ^1.2.0
flutter: 2.5.3

E/AndroidRuntime(19455): FATAL EXCEPTION: main
E/AndroidRuntime(19455): Process: com.evermos.evm.stag, PID: 19455
E/AndroidRuntime(19455): java.lang.RuntimeException: Unable to stop activity {com.vnotes.app.stag/com.vnotes.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference
E/AndroidRuntime(19455):        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4856)
E/AndroidRuntime(19455):        at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4827)
E/AndroidRuntime(19455):        at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4901)
E/AndroidRuntime(19455):        at android.app.servertransaction.StopActivityItem.execute(StopActivityItem.java:40)
E/AndroidRuntime(19455):        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
E/AndroidRuntime(19455):        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
E/AndroidRuntime(19455):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime(19455):        at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(19455):        at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(19455):        at android.app.ActivityThread.main(ActivityThread.java:7664)
E/AndroidRuntime(19455):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(19455):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(19455):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime(19455): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference
E/AndroidRuntime(19455):        at com.rudderstack.android.sdk.core.RudderElementCache.getCachedContext(Unknown Source:2)
E/AndroidRuntime(19455):        at com.rudderstack.android.sdk.core.RudderMessage.<init>(Unknown Source:58)
E/AndroidRuntime(19455):        at com.rudderstack.android.sdk.core.RudderMessageBuilder.build(Unknown Source:2)
E/AndroidRuntime(19455):        at com.rudderstack.android.sdk.core.RudderClient.track(Unknown Source:16)
E/AndroidRuntime(19455):        at C2.c.b(:1)
E/AndroidRuntime(19455):        at C2.b.run(Unknown Source:0)
E/AndroidRuntime(19455):        at C2.c.onActivityStopped(Unknown Source:18)
E/AndroidRuntime(19455):        at android.app.Application.dispatchActivityStopped(Application.java:496)
E/AndroidRuntime(19455):        at android.app.Activity.dispatchActivityStopped(Activity.java:1445)
E/AndroidRuntime(19455):        at android.app.Activity.onStop(Activity.java:2591)
E/AndroidRuntime(19455):        at io.flutter.embedding.android.f.onStop(Unknown Source:0)
E/AndroidRuntime(19455):        at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1482)
E/AndroidRuntime(19455):        at android.app.Activity.performStop(Activity.java:8209)
E/AndroidRuntime(19455):        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4848)
E/AndroidRuntime(19455):        ... 12 more

Release Mode Live Events

I tried to track events using release mode and see event tracked via LiveEvent. But, after I waited long enough, the event still didn't show up either. With the same code, but change to debug mode it's work.

Error StandardMethodCodec.java line 607 StandardMethodCodec.decodeEnvelope

We try to publish android app using Rudder Stack. Our Firebase Crashlytics record non-fatal issue, but in the screen affected change widget to blank white.

Below the title error information from crashlytics:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError
PlatformException(error, Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference at com.rudderstack.android.sdk.core.RudderElementCache.getCachedContext(Unknown Source:2) at com.rudderstack.android.sdk.core.RudderMessage.<init>(Unknown Source:58) at com.rudderstack.android.sdk.core.RudderMessageBuilder.build(Unknown Source:2) at com.rudderstack.android.sdk.core.RudderClient.track(Unknown Source:24) at D2.d.onMethodCall(:4) at R2.c.a(:4) at G2.i.h(Unknown Source:11) at G2.i.g(:3) at G2.e.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) ). Error thrown null.

Below detail error information from crashlytics:

Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PlatformException(error, Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'com.rudderstack.android.sdk.core.RudderContext com.rudderstack.android.sdk.core.RudderContext.copy()' on a null object reference
	at com.rudderstack.android.sdk.core.RudderElementCache.getCachedContext(Unknown Source:2)
	at com.rudderstack.android.sdk.core.RudderMessage.<init>(Unknown Source:58)
	at com.rudderstack.android.sdk.core.RudderMessageBuilder.build(Unknown Source:2)
	at com.rudderstack.android.sdk.core.RudderClient.track(Unknown Source:24)
	at D2.d.onMethodCall(:4)
	at R2.c.a(:4)
	at G2.i.h(Unknown Source:11)
	at G2.i.g(:3)
	at G2.e.run(Unknown Source:12)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7562)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
). Error thrown null.
       at StandardMethodCodec.decodeEnvelope(StandardMethodCodec.java:607)
       at MethodChannel._invokeMethod(MethodChannel.java:167)

I think this problem under Android Native SDK that connected with flutter plugin. Or I implement the wrong approach to track using Rudderstack?

rudder_plugin_ios not found (v2.0.0)

Hi
I created a new flutter project and integrated RudderStack in it but when I tried to run the app on android I got the following error.

Error:-

Plugin project :rudder_plugin_ios not found. Please update settings.gradle.

FAILURE: Build failed with an exception.

* Where:
Script '/opt/homebrew/Caskroom/flutter/2.10.3/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 421

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Cannot invoke method afterEvaluate() on null object

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

flutter doctor output

[βœ“] Flutter (Channel stable, 2.10.3, on macOS 12.1 21C52 darwin-arm, locale en-IN)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2021.1)
[βœ“] Android Studio (version 2021.1)
[βœ“] Connected device (1 available)
[βœ“] HTTP Host Availability

β€’ No issues found!

Steps to reproduce:-

  1. create new flutter project
  2. add rudder_sdk_flutter plugin in pubspec.yaml
  3. run main.dart

rudder_sdk_flutter: ^2.0.1 Can not initialize Rudder Client from flutter web

Can not initialize Rudder Client from flutter web.

JSNoSuchMethodError was thrown building:
TypeError: Cannot read properties of undefined (reading 'load')

final RudderController rudderClient = RudderController.instance;
RudderConfigBuilder builder = RudderConfigBuilder();
builder.withDataPlaneUrl("https://hosted.rudderlabs.com");
builder.withLogLevel(RudderLogger.VERBOSE);
rudderClient.initialize("key",
config: builder.build());

I have also tried 2.1.1

BUG : ARC Semantic Issue after updating XCode to version 15

Describe the bug
Hey Guys, I'm facing this issue after updating XCode to version 15

I Can't build an app on either emulator or physical device.

Could not build the precompiled application for the device.
ARC Semantic Issue (Xcode): No visible @interface for 'RSDBEncryption' declares the selector 'initWithKey:enable:'
/.pub-cache/hosted/pub.dev/rudder_plugin_ios-2.4.0/ios/Classes/RudderSdkFlutterPlugin.m:193:64

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

  • Android
  • iOS
  • Both Android and iOS

Version of the Flutter SDK
Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[βœ“] Flutter (Channel stable, 3.13.4, on macOS 13.5.2 22G91 darwin-arm64, locale en-BR)
[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[βœ“] Xcode - develop for iOS and macOS (Xcode 15.0)
[βœ“] Chrome - develop for the web
[βœ“] Android Studio (version 2022.2)
[βœ“] VS Code (version 1.82.1)
[βœ“] Connected device (4 available)
[βœ“] Network resources

Rudder SDK Flutter Version:

rudder_sdk_flutter: ^2.5.0
rudder_sdk_flutter_platform_interface: ^2.3.0

Could you please help me?

Thank you very much.

Cannot receive any events in a flutter release build (only on Android)

Hello!

I have a flutter and have successfully integrated rudder_sdk_flutter along with rudder_integration_braze_flutter SDKs.
When I run my app in debug/dev mode, everything is working fine. I got my events in flutter source in Rudderstack, and those events are then sent to Braze (iOS and android).

I’m actually having an issue while running my app in release mode on android flutter run --release.
I don’t see events coming to my flutter source on Rudderstack, so nothing is happening on Braze as well.

This only happens when running the app in release mode and only on android.

Am I missing something here?

Here's how I initialize the rudder client:

void initRudderstack() {
  RudderConfigBuilder builder = RudderConfigBuilder();

  builder.withDataPlaneUrl(dotenv.env["RUDDESRSTACK_DATA_PLANE"]!);
  builder.withControlPlaneUrl("https://api.rudderlabs.com");
  builder.withLogLevel(RudderLogger.VERBOSE);

// This is used to integrace rudderstack-braze connection via device mode
  builder.withFactory(RudderIntegrationBrazeFlutter());

  RudderOption options = RudderOption();

  String writeKey = dotenv.env["RUDDESRSTACK_WRITE_KEY"]!;

  RudderClient.instance
      .initialize(writeKey, config: builder.build(), options: options);

}

I'm using:

  rudder_integration_braze_flutter: 1.0.2
  rudder_sdk_flutter: ^2.3.0

flutter doctor -v

[βœ“] Flutter (Channel stable, 3.7.3, on macOS 12.5.1 21G83 darwin-arm64, locale en-FR)
    β€’ Flutter version 3.7.3 on channel stable at /Users/ghassen/dev/tools/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 9944297138 (7 days ago), 2023-02-08 15:46:04 -0800
    β€’ Engine revision 248290d6d5
    β€’ Dart version 2.19.2
    β€’ DevTools version 2.20.1

[βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    β€’ Android SDK at /Users/ghassen/Library/Android/sdk
    β€’ Platform android-33, build-tools 33.0.0
    β€’ ANDROID_HOME = /Users/ghassen/Library/Android/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 14.2)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Build 14C18
    β€’ CocoaPods version 1.11.3

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2021.3)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[βœ“] VS Code (version 1.74.3)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.58.0

[βœ“] Connected device (3 available)
    β€’ EDA52 (mobile)  β€’ 22021B1B40 β€’ android-arm64  β€’ Android 11 (API 30)
    β€’ macOS (desktop) β€’ macos      β€’ darwin-arm64   β€’ macOS 12.5.1 21G83 darwin-arm64
    β€’ Chrome (web)    β€’ chrome     β€’ web-javascript β€’ Google Chrome 109.0.5414.119

[βœ“] HTTP Host Availability
    β€’ All required HTTP hosts are available

β€’ No issues found!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.