Skip to content

[ANDROID] serviceName plugin option is ignored #62

Description

@marco-saia-datadog

Describe what happened

The error tracking option serviceName is not picked up on Android, starting from v2.8.0 of Datadog React Native SDK.

Reported by @FrikkieSnyman on DataDog/dd-sdk-reactnative#879 (comment)

Steps to reproduce the issue

Use a custom serviceName

[
  'expo-datadog',
  {
    errorTracking: {
      serviceName: 'custom-service-name',
      iosSourcemaps: true,
      androidSourcemaps: true,
    }
  }
]

The android/app/build.gradle is modified as follows:

plugins {
    id("com.datadoghq.dd-sdk-android-gradle-plugin") version "1.14.0"
}

datadog {
    checkProjectDependencies = "none"
    serviceName = "custom-service-name"
}
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply from: "node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle"

Leading to serviceName not being picked up, due to the fact that the Datadog React Native SDK expects it to be in project.ext.datadog properties.

Expected outcome

The serviceName is defined in the project.ext.datadog properties, and the React Native SDK picks up the serviceName from datadog as a fallback for retro-compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions