cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
maliborskaya
Dynatrace Advisor
Dynatrace Advisor

 

Why do I see the message `OneAgent SDK version <version_number> does not match Dynatrace Android Gradle plugin version <version_number>`?

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.

Why does my build fail with `Plugin with id com.dynatrace.instrumentation not found`?

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.

Why does my build fail with `Could not find com.dynatrace.tools.android:gradle-plugin:<version_number>`?

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.

Why does my build fail with `Could not find any version that matches com.dynatrace.tools.android:gradle-plugin:<version_number>.+.`?

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.

Why does my build fail with `Could not get unknown property dynatrace for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler`?

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.

Groovy

apply plugin: 'com.dynatrace.instrumentation'

dynatrace {
...
}

Kotlin

apply(plugin = "com.dynatrace.instrumentation")

configure<com.dynatrace.tools.android.dsl.DynatraceExtension> {
...
}

Why does my build fail with `No configuration for the Dynatrace Android Gradle plugin found! Please copy the configuration block from the instrumentation wizard to the proper location.`?

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.

Why do I see the message `Task printVariantAffiliation not found in project :<module_name>`?

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.

Why do I see the message `The Dynatrace Android Gradle Plugin can only be applied to Android projects`?

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.

Why do I see the message `The Dynatrace Android Gradle plugin must be applied in the top-level build.gradle (or build.gradle.kts) file`?

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.

Why do I see the message `The Dynatrace Android Gradle plugin can't be directly applied to a Java- or Android-related module`?

Your project does not use the recommended architecture; it uses an uncommon project architecture.

Why do I see the message `It is not possible to use both Dynatrace plugins ('com.dynatrace.instrumentation' and 'com.dynatrace.instrumentation.module') for the same module`?

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.

 

If you can't resolve a build problem with the Dynatrace Android Gradle plugin used for your mobile applications, please contact a Dynatrace product expert via live chat within your Dynatrace environment and provide the logs.

For general issues, refer to Mobile applications: General issues with Dynatrace Android Gradle plugin.

Version history
Last update:
‎19 Jan 2024 11:35 AM
Updated by: