How to update Dynatrace mobile plugins

How to update Dynatrace mobile plugins

Overview

Keeping your Dynatrace mobile plugin up to date ensures you receive the latest features, performance improvements, and bug fixes. This article explains how to update the Dynatrace plugin for each supported mobile platform.

Supported platforms

  • Android (Dynatrace Android Gradle plugin)
  • iOS (Swift Package Manager)
  • React Native
  • Flutter
  • .NET MAUI
  • Cordova

Check the latest plugin version

Before updating, check the latest available version for your platform:

Android

Update the Dynatrace Android Gradle plugin

  1. Open your project-level build.gradle (or build.gradle.kts) file.

  2. Find the Dynatrace plugin dependency:

    classpath 'com.dynatrace.tools.android:gradle-plugin:8.+'
    
    

    Using 8.+ allows Gradle to automatically pull the latest minor version within the current major version.

    If you apply the plugin with the Plugin DSL instead, find the following line in the plugins block:

    id 'com.dynatrace.instrumentation' version '8.+' apply true
    
    
  3. To update to a new major version, change the version number manually:

    classpath 'com.dynatrace.tools.android:gradle-plugin:<new-major-version>.+'
    
    

    Note: New major versions might include breaking changes. Review the OneAgent for Mobile release notes before upgrading.

  4. In Android Studio, go to File > Sync Project with Gradle Files.

  5. Build your app to confirm there are no errors.

Note: Recent plugin versions raised the minimum requirements. Version 8.343 requires Android API level 23, Android Gradle plugin 8.1.1, Gradle 8.0, and Java 17. Check the OneAgent for Mobile release notes for the version you’re targeting.

Upgrade to a specific version

To pin to a specific version, replace 8.+ with the exact version number (for example, 8.339.0):

classpath 'com.dynatrace.tools.android:gradle-plugin:8.339.0'

After syncing, build your app to confirm there are no errors.

iOS

Update via Swift Package Manager (recommended)

Dynatrace recommends Swift Package Manager (SPM) for iOS instrumentation. If you’re still using CocoaPods, see Migrate from CocoaPods to Swift Package Manager below.

  1. In Xcode, go to File > Packages > Update to Latest Package Versions.
  2. Xcode resolves and downloads the latest version of the Dynatrace Swift SDK that your current version rule allows.

To change the version rule or upgrade to a specific version, remove the package and add it again with the new rule:

  1. In Xcode, select your project (not a target) and select the Package Dependencies pane.

  2. Select the swift-mobile-sdk package entry and remove it.

  3. Go to File > Add Package Dependencies and enter the Dynatrace Swift SDK repository URL again:

    https://github.com/Dynatrace/swift-mobile-sdk.git
    
    
  4. Choose the version rule. To pin to a specific version, select Exact Version and enter the version number (for example, 8.339.0). To always use the latest compatible release, select Up to Next Major Version.

  5. Select Add Package, choose the same product you used before (for example, Dynatrace), and rebuild your app.

Migrate from CocoaPods to Swift Package Manager

The CocoaPods Specs repository becomes read-only in December 2026. After that, Dynatrace can no longer publish new OneAgent SDK versions for iOS to CocoaPods, including hotfixes and critical updates. If you’re still using CocoaPods, migrate to SPM to continue receiving updates.

  1. Remove the existing CocoaPods entry from your Podfile:

    pod 'Dynatrace'
    
    
  2. Run pod deintegrate to remove CocoaPods from your project.

  3. In Xcode, go to File > Add Package Dependencies.

  4. Enter the Dynatrace Swift SDK repository URL:

    https://github.com/Dynatrace/swift-mobile-sdk.git
    
    
  5. Select the version rule and select Add Package, then choose the Dynatrace product.

  6. Rebuild your app.

React Native

Update the Dynatrace React Native plugin

  1. In your project root, run one of the following commands depending on your package manager:

    • npm:

      npm install @dynatrace/react-native-plugin@latest
      
      
    • yarn:

      yarn upgrade @dynatrace/react-native-plugin
      
      
  2. For iOS, update CocoaPods dependencies:

    cd ios && pod install
    
    
  3. Run the following command to apply the configuration to the native Android and iOS projects:

    npx instrumentdynatrace
    
    
  4. Rebuild your app for Android and iOS.

Upgrade to a specific version

Replace @latest with the exact version number (for example, 2.339.1):

  • npm:

    npm install @dynatrace/react-native-plugin@2.339.1
    
    
  • yarn:

    yarn add @dynatrace/react-native-plugin@2.339.1
    
    

After installing, run pod install in the ios directory, run npx instrumentdynatrace, and rebuild your app.

Flutter

Update the Dynatrace Flutter plugin

  1. Open your pubspec.yaml file and update the version constraint for the plugin:

    dependencies:
      dynatrace_flutter_plugin: ^<latest-version>   # for example, ^3.347.1
    
    
  2. Run the following command to fetch the updated package:

    flutter pub get
    
    
  3. Run the following command to update the native Android and iOS dependencies:

    dart run dynatrace_flutter_plugin
    
    
  4. Rebuild your app:

    flutter build apk   # Android
    flutter build ios   # iOS
    
    

Upgrade to a specific version

Pin the exact version in pubspec.yaml:

dependencies:
  dynatrace_flutter_plugin: 3.345.2

Then run flutter pub get and dart run dynatrace_flutter_plugin, and rebuild your app.

.NET MAUI

Update the Dynatrace .NET MAUI NuGet package

Note: Support for the Dynatrace Xamarin NuGet package ended in May 2025. If you’re still using Xamarin, migrate your project to .NET MAUI. See Instrument mobile apps with Dynatrace .NET MAUI NuGet package for migration guidance.

  1. In Visual Studio, right-click your solution and select Manage NuGet Packages.
  2. Search for Dynatrace.OneAgent.MAUI.
  3. Select the package and select Update to install the latest version.
  4. Rebuild your app to confirm there are no errors.

Upgrade to a specific version

  1. In Visual Studio, right-click your solution and select Manage NuGet Packages.
  2. Search for Dynatrace.OneAgent.MAUI.
  3. In the Version dropdown, select the version you want to install and select Update.
  4. Rebuild your app to confirm there are no errors.

Cordova

Update the Dynatrace Cordova plugin

  1. Run the following command to update the plugin:

    cordova plugin update @dynatrace/cordova-plugin
    
    

    If the update command is not available for your version of the Cordova CLI, remove and re-add the plugin:

    cordova plugin remove @dynatrace/cordova-plugin
    cordova plugin add @dynatrace/cordova-plugin@latest --save
    
    

    Note: If you’re still using the legacy dynatrace-cordova-plugin package (version 1.x), you must remove it with cordova plugin remove dynatrace-cordova-plugin and then add @dynatrace/cordova-plugin@latest --save. The update command does not migrate between the two packages.

  2. Rebuild your app for the target platform:

    cordova build android
    cordova build ios
    
    

Upgrade to a specific version

Append @<version> when adding the plugin:

cordova plugin remove @dynatrace/cordova-plugin
cordova plugin add @dynatrace/cordova-plugin@2.341.1 --save

Then rebuild your app for the target platform.

What’s next

3 Likes