Skip to content

Attempting to call setInternalViewAttribute on RUM when it has not been enabled #869

@rimastide

Description

@rimastide

Describe the bug

Hi, in our datadog error reports, we are experiencing the error:

PlatformException(DatadogSdk:InvalidOperation, 
Attempting to call setInternalViewAttribute on RUM when it has not been enabled, 
null, null)

The error occurs intermittently on Android only when DatadogNavigationObserver attempts to call markViewFirstBuildComplete() after a navigation event. The error originates from the Android native side guard clause in DatadogRumPlugin.kt:

override fun onMethodCall(call: MethodCall, result: Result) {
    if (call.method != "enable" && rum == null) {
        result.invalidOperation(
            "Attempting to call ${call.method} on RUM when it has not been enabled"
        )
        return
    }
    // ...
}

Reproduction steps

The error occurs only on Android devices. It is currently unknown whether the issue also appears on emulators, but it has been confirmed on physical devices.

The bug cannot be consistently reproduced, and the root cause is not yet identified.

SDK logs

No response

Expected behavior

No response

Affected SDK versions

2.11.0

Latest working SDK version

No response

Did you confirm if the latest SDK version fixes the bug?

No

Flutter Version

3.35.4

Setup Type

No response

Device Information

Various Android devices running Android OS version 12-16.

Few of the devices examples would be:
Samsung SM-M135FU, Pixel 7 Pro, Pixel 9a

Other relevant information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions