[Alpha] Upgrade the Splunk RUM React Native agent

Migrate existing deployments to the new Splunk RUM React Native agent.

Attention:

Alpha features described in this document are provided by Splunk to you "as is" without any warranties, maintenance and support, or service-level commitments. Splunk makes this alpha feature available in its sole discretion and may discontinue it at any time. These documents are not yet publicly available and we ask that you keep such information confidential. Use of alpha features is subject to the Splunk Pre-Release Agreement for Hosted Services.

Note: If you don't have existing React Native instrumentation, skip this page. Go directly to [Alpha] Install the Splunk RUM React Native agent.

If you're using the old Splunk RUM React Native agent in your React Native applications, follow these steps to migrate your applications to the new Splunk RUM React Native agent.

  1. Update the API class package imports:

    Rename the API class package, which includes SplunkRum and SplunkRumBuilder, from com.splunk.rum to com.splunk.rum.integration.agent.api.

  2. Remove the library dependency on io.opentelemetry.android:instrumentation from your gradle file.

    With the new Splunk RUM React Native agent, its inclusion leads to AAR metadata errors with duplicate classes.

  3. Remove the line below your dependencies (the upstream opentelemetry-android repository) because it's already linked in our SDK:
    implementation("io.opentelemetry.android:instrumentation:2.1.0") 
  4. If you're using import com.splunk.rum.StandardAttributes, change it to import com.splunk.rum.integration.agent.api.attributes.StandardAttributes.
    Note: import com.splunk.rum.StandardAttributes is deprecated.
  5. Change the version of compileSdk to 35 and AGP to 8.6.0.

    If you can't upgrade to compileSdk version 35 and the newer AGP, add this block to your build.gradle to force compatible Android library versions. Remember to update the kotlin-stdlib version as needed:

    configurations.all {
        resolutionStrategy {
            force("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
            force("androidx.core:core:1.13.1")
            force("androidx.core:core-ktx:1.13.1")
        }
    }
  6. Initialize the Splunk RUM React Native agent:

The following configurations are not supported and are deprecated in the new Splunk RUM React Native agent:

  • enableDiskBuffering()

  • enableReactNativeSupport()

  • VolleyTracing and VolleyTracingBuilder

  • updateLocation(@Nullable Location location)

  • experimentalSetScreenName has a replacement API

  • Call.Factory createRumOkHttpCallFactory(OkHttpClient client) has a replacement API

The best practice is to replace all deprecated configurations and APIs with the new ones provided by this new Splunk RUM agent.