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: Maven Central: Dynatrace Android Gradle plugin
- iOS / Swift Package Manager: github.com/Dynatrace/swift-mobile-sdk
- React Native: npmjs.com: @dynatrace/react-native-plugin
- Flutter: pub.dev: dynatrace_flutter_plugin
- .NET MAUI: nuget.org: Dynatrace.OneAgent.MAUI
- Cordova: npmjs.com: @dynatrace/cordova-plugin
Android
Update the Dynatrace Android Gradle plugin
-
Open your project-level
build.gradle(orbuild.gradle.kts) file. -
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
pluginsblock:id 'com.dynatrace.instrumentation' version '8.+' apply true -
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.
-
In Android Studio, go to File > Sync Project with Gradle Files.
-
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.
- In Xcode, go to File > Packages > Update to Latest Package Versions.
- 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:
-
In Xcode, select your project (not a target) and select the Package Dependencies pane.
-
Select the swift-mobile-sdk package entry and remove it.
-
Go to File > Add Package Dependencies and enter the Dynatrace Swift SDK repository URL again:
https://github.com/Dynatrace/swift-mobile-sdk.git -
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. -
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.
-
Remove the existing CocoaPods entry from your
Podfile:pod 'Dynatrace' -
Run
pod deintegrateto remove CocoaPods from your project. -
In Xcode, go to File > Add Package Dependencies.
-
Enter the Dynatrace Swift SDK repository URL:
https://github.com/Dynatrace/swift-mobile-sdk.git -
Select the version rule and select Add Package, then choose the Dynatrace product.
-
Rebuild your app.
React Native
Update the Dynatrace React Native plugin
-
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
-
-
For iOS, update CocoaPods dependencies:
cd ios && pod install -
Run the following command to apply the configuration to the native Android and iOS projects:
npx instrumentdynatrace -
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
-
Open your
pubspec.yamlfile and update the version constraint for the plugin:dependencies: dynatrace_flutter_plugin: ^<latest-version> # for example, ^3.347.1 -
Run the following command to fetch the updated package:
flutter pub get -
Run the following command to update the native Android and iOS dependencies:
dart run dynatrace_flutter_plugin -
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.
- In Visual Studio, right-click your solution and select Manage NuGet Packages.
- Search for
Dynatrace.OneAgent.MAUI. - Select the package and select Update to install the latest version.
- Rebuild your app to confirm there are no errors.
Upgrade to a specific version
- In Visual Studio, right-click your solution and select Manage NuGet Packages.
- Search for
Dynatrace.OneAgent.MAUI. - In the Version dropdown, select the version you want to install and select Update.
- Rebuild your app to confirm there are no errors.
Cordova
Update the Dynatrace Cordova plugin
-
Run the following command to update the plugin:
cordova plugin update @dynatrace/cordova-pluginIf 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 --saveNote: If you’re still using the legacy
dynatrace-cordova-pluginpackage (version 1.x), you must remove it withcordova plugin remove dynatrace-cordova-pluginand then add@dynatrace/cordova-plugin@latest --save. The update command does not migrate between the two packages. -
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
- Review the OneAgent for Mobile release notes to understand what changed in the latest version.
- If your Android build fails after an update, see Mobile applications: Build issues with Dynatrace Android Gradle plugin and Mobile applications: General issues with Dynatrace Android Gradle plugin.
- If you can’t resolve an issue after updating, open a support case at support.dynatrace.com.