Skip to content

Android build error: Could not get unknown property 'configurationFilePath' for extension 'datadog' of type com.datadog.gradle.plugin.DdExtension #878

@lukasz-app

Description

@lukasz-app

Describe the issue

I added DataDog SDK to the project, and we're using the datadog-configuration.json file as sepecified in the docs:
https://docs.datadoghq.com/real_user_monitoring/guide/initialize-your-native-sdk-before-react-native-starts/?tab=android

This works fine.
The top of our android/app/gradle/build file looks like:

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

apply from: "../../node_modules/@datadog/mobile-react-native/datadog-configuration.gradle"
....

The issue starts when I try to add deobfuscation of stack traces to our android gradle file, as mentioned here:
https://docs.datadoghq.com/real_user_monitoring/mobile_and_tv_monitoring/react_native/error_tracking/#get-deobfuscated-stack-traces

I add additional lines to the android/app/gradle/build file, so it looks like this:

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

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

apply from: "../../node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle"
apply from: "../../node_modules/@datadog/mobile-react-native/datadog-configuration.gradle"

This results in build error:
FAILURE: Build failed with an exception.

  • Where:
    Script 'my_app/node_modules/@datadog/mobile-react-native/datadog-configuration.gradle' line: 9
  • What went wrong:
    A problem occurred evaluating script.

Could not get unknown property 'configurationFilePath' for extension 'datadog' of type com.datadog.gradle.plugin.DdExtension.

Reproduction steps

  1. Add datadog react native SDK to the project
  2. Use datadog-configuration.json file for initialization
  3. Add those lines to the android/app/build.gradle file
plugins {
    id("com.datadoghq.dd-sdk-android-gradle-plugin") version "1.16.0"
}
apply from: "../../node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle"
  1. Build error: Could not get unknown property 'configurationFilePath' for extension 'datadog' of type com.datadog.gradle.plugin.DdExtension.

SDK logs

No response

Device Information

No response

SDK version

"@datadog/mobile-react-native": "2.7.0",

Integration Methods

NPM

React Native Version

0.76.9

Package.json Contents

No response

iOS Setup

No response

Android Setup

No response

Other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsetup

    Type

    No type
    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