Dynatrace Android Gradle plugin FAQ
Find out how to solve problems related to Android mobile app monitoring. For more general issues, see Troubleshooting RUM for mobile apps.
General
Only web requests from a supported HTTP framework are captured. Check if your HTTP framework is on this list. If it isn't, instrument your web requests manually.
Also see Why am I missing web requests when I use the Firebase plugin?.
OneAgent for Android only attaches web requests to a user action triggered within a specific timeframe. The timeframe starts when the action opens and ends 500
ms after the action closes. You can change this value with the userActions.timeout
property.
There can be multiple reasons why OneAgent for Android can't create a user action:
- The UI component is defined in
WebView
. - The UI component uses an unsupported listener. You can find the list of all supported listeners in the user action monitoring section.
The Dynatrace Android Gradle plugin is compatible with the Firebase Performance Monitoring plugin. However, there are some limitations.
If you are using Firebase Performance Monitoring plugin version 1.4.0+ with Android Gradle plugin version 4.2.x, you will be affected. The Firebase Performance Monitoring plugin uses an instrumentation approach that is incompatible with the Dynatrace Android Gradle plugin on this version of the Android Gradle plugin.
To see whether your build is affected, check the versions specified in the build.gradle
file.
gradledependencies {
classpath 'com.android.tools.build:gradle:4.2.0' // Android Gradle plugin
classpath 'com.google.firebase:perf-plugin:1.4.0' // Firebase Performance Monitoring plugin
}
Solution: Upgrade the Android Gradle plugin to version 7.0.0+, and use the latest version of the Dynatrace Android Gradle plugin.
No. The preview interactive mode runs directly inside Android Studio in a sandbox environment, which results in some limitations such as no network and file access. In this mode, the auto-instrumentation step is not executed and OneAgent is not started.
Build problems
OneAgent SDK and the Dynatrace Android Gradle plugin must have the same version. You may have added OneAgent SDK (with a higher version) via a Gradle dependency to your Android application project.
Check if you've added the Dynatrace Android Gradle plugin to the build script classpath. See Instrument your application via Dynatrace Android Gradle plugin for detailed instructions.
This is because Gradle was unable to find the specified version. Check if you've specified the correct version number. You can check the available version on Maven Central. You must also ensure that the Maven Central repository is declared. See Instrument your application via Dynatrace Android Gradle plugin for the detailed instructions.
Gradle was unable to find a version that matches your version settings. You can check the available version on Maven Central. You must also ensure that the Maven Central repository is declared. See Instrument your application via Dynatrace Android Gradle plugin for the detailed instructions.
Check if you've applied the Dynatrace Android Gradle plugin before the dynatrace
/ configure<com.dynatrace.tools.android.dsl.DynatraceExtension>
block dependency. See Instrument your application via Dynatrace Android Gradle plugin for the detailed instructions.
gradleapply plugin: 'com.dynatrace.instrumentation'
dynatrace {
...
}
gradleapply(plugin = "com.dynatrace.instrumentation")
configure<com.dynatrace.tools.android.dsl.DynatraceExtension> {
...
}
You applied the Dynatrace Android Gradle plugin to your build file (top-level or module-level build file), but you didn't provide a plugin configuration. Check Instrument your application via Dynatrace Android Gradle plugin to learn how to add the plugin configuration snippet.
For React Native apps, follow the troubleshooting instructions at Dynatrace React Native Plugin documentation.
Ensure that you've added the Dynatrace Android Gradle plugin to the build script classpath and applied the plugin. Check Instrument your application via Dynatrace Android Gradle plugin for the detailed instructions.
The Dynatrace Android Gradle plugin only generates new Gradle tasks (like the printVariantAffiliation
task) for specific subprojects of your Android application project. It does not generate tasks for the root project and some subproject. For example, the Dynatrace Android Gradle plugin doesn't generate the printVariantAffiliation
for Android library modules.
You can only use the Dynatrace Android Gradle plugin when your Android project is built with the Android Gradle plugin. This error message is displayed when the Dynatrace Android Gradle plugin is used in non-Android projects or in Android projects that are not built via the Android Gradle plugin.
The plugin with the com.dynatrace.instrumentation
ID must be applied in the top-level build file file. Most likely, you've added the plugin configuration to the wrong build file. Verify that the plugin is used in the correct build file. Check Instrument your application via Dynatrace Android Gradle plugin for the detailed instructions.
Your project does not use the recommended architecture; it uses an uncommon project architecture.
- If your Android project contains only one build file, follow the steps in Projects with one build file.
- For other project architectures, check Change Dynatrace Android Gradle plugin configuration based on the project structure or contact a Dynatrace product expert via live chat.
The plugin with the com.dynatrace.instrumentation
ID automatically configures all modules in your project. Therefore, you don't need to use the plugin with the com.dynatrace.instrumentation.module
ID. See Change Dynatrace Android Gradle plugin configuration based on the project structure to understand when you should use the plugin with the com.dynatrace.instrumentation.module
ID.