<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Mobile applications: Build issues with Dynatrace Android Gradle plugin in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Mobile-applications-Build-issues-with-Dynatrace-Android-Gradle/ta-p/234750</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `OneAgent SDK version &amp;lt;version_number&amp;gt; does not match Dynatrace Android Gradle plugin version &amp;lt;version_number&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Plugin with id com.dynatrace.instrumentation not found`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Check if you've added the Dynatrace Android Gradle plugin to the build script classpath. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not find com.dynatrace.tools.android:gradle-plugin:&amp;lt;version_number&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not find any version that matches com.dynatrace.tools.android:gradle-plugin:&amp;lt;version_number&amp;gt;.+.`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not get unknown property dynatrace for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Check if you've applied the Dynatrace Android Gradle plugin before the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;dynatrace&lt;/CODE&gt;&amp;nbsp;/&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;configure&amp;lt;com.dynatrace.tools.android.dsl.DynatraceExtension&amp;gt;&lt;/CODE&gt;&amp;nbsp;block dependency. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Groovy&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;apply plugin: 'com.dynatrace.instrumentation'

dynatrace {
...
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Kotlin&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;apply(plugin = "com.dynatrace.instrumentation")

configure&amp;lt;com.dynatrace.tools.android.dsl.DynatraceExtension&amp;gt; {
...
}&lt;/LI-CODE&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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.`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to learn how to add the plugin configuration snippet.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For React Native apps, follow the troubleshooting instructions at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://www.npmjs.com/package/@dynatrace/react-native-plugin#troubleshooting-and-applicable-restrictions" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;Dynatrace React Native Plugin documentation&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `Task printVariantAffiliation not found in project :&amp;lt;module_name&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Ensure that you've added the Dynatrace Android Gradle plugin to the build script classpath and applied the plugin. Check&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for the detailed instructions.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The Dynatrace Android Gradle plugin only generates new Gradle tasks (like the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;printVariantAffiliation&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;printVariantAffiliation&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures#library-modules" target="_self" data-testid="link"&gt;Android library modules&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `The Dynatrace Android Gradle Plugin can only be applied to Android projects`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation&lt;/CODE&gt;&amp;nbsp;ID must be applied in the&amp;nbsp;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://dt-url.net/top-level-build-file" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;top-level build file&lt;/A&gt;&amp;nbsp;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `The Dynatrace Android Gradle plugin can't be directly applied to a Java- or Android-related module`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Your project does not use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://developer.android.com/studio/build#build-files" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;recommended architecture&lt;/A&gt;; it uses an uncommon project architecture.&lt;/P&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;If your Android project contains only one build file, follow the steps in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures#one-build-file" target="_self" data-testid="link"&gt;Projects with one build file&lt;/A&gt;.&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;For other project architectures, check&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures" target="_self" data-testid="link"&gt;Change Dynatrace Android Gradle plugin configuration based on the project structure&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or contact a Dynatrace product expert via live chat.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation&lt;/CODE&gt;&amp;nbsp;ID automatically configures all modules in your project. Therefore, you don't need to use the plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation.module&lt;/CODE&gt;&amp;nbsp;ID. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures" target="_self" data-testid="link"&gt;Change Dynatrace Android Gradle plugin configuration based on the project structure&lt;/A&gt;&amp;nbsp;to understand when you should use the plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation.module&lt;/CODE&gt;&amp;nbsp;ID.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can't resolve a build problem with the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-overview" target="_self" rel="noopener noreferrer"&gt;Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;used for your mobile applications, please contact a Dynatrace product expert via live chat within your Dynatrace environment and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/android-logging-oneagent" target="_self" rel="noopener noreferrer"&gt;provide&amp;nbsp;the logs&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For general issues, refer to&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Mobile-applications-General-issues-with-Dynatrace-Android-Gradle/ta-p/234748" target="_self"&gt;Mobile applications: General issues with Dynatrace Android Gradle plugin&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 09 May 2024 16:23:46 GMT</pubDate>
    <dc:creator>maliborskaya</dc:creator>
    <dc:date>2024-05-09T16:23:46Z</dc:date>
    <item>
      <title>Mobile applications: Build issues with Dynatrace Android Gradle plugin</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Mobile-applications-Build-issues-with-Dynatrace-Android-Gradle/ta-p/234750</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `OneAgent SDK version &amp;lt;version_number&amp;gt; does not match Dynatrace Android Gradle plugin version &amp;lt;version_number&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Plugin with id com.dynatrace.instrumentation not found`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Check if you've added the Dynatrace Android Gradle plugin to the build script classpath. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not find com.dynatrace.tools.android:gradle-plugin:&amp;lt;version_number&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not find any version that matches com.dynatrace.tools.android:gradle-plugin:&amp;lt;version_number&amp;gt;.+.`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Why does my build fail with `Could not get unknown property dynatrace for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Check if you've applied the Dynatrace Android Gradle plugin before the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;dynatrace&lt;/CODE&gt;&amp;nbsp;/&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;configure&amp;lt;com.dynatrace.tools.android.dsl.DynatraceExtension&amp;gt;&lt;/CODE&gt;&amp;nbsp;block dependency. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Groovy&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;apply plugin: 'com.dynatrace.instrumentation'

dynatrace {
...
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Kotlin&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;apply(plugin = "com.dynatrace.instrumentation")

configure&amp;lt;com.dynatrace.tools.android.dsl.DynatraceExtension&amp;gt; {
...
}&lt;/LI-CODE&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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.`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to learn how to add the plugin configuration snippet.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;For React Native apps, follow the troubleshooting instructions at&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://www.npmjs.com/package/@dynatrace/react-native-plugin#troubleshooting-and-applicable-restrictions" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;Dynatrace React Native Plugin documentation&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `Task printVariantAffiliation not found in project :&amp;lt;module_name&amp;gt;`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Ensure that you've added the Dynatrace Android Gradle plugin to the build script classpath and applied the plugin. Check&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for the detailed instructions.&lt;/P&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;The Dynatrace Android Gradle plugin only generates new Gradle tasks (like the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;printVariantAffiliation&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;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&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;printVariantAffiliation&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures#library-modules" target="_self" data-testid="link"&gt;Android library modules&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `The Dynatrace Android Gradle Plugin can only be applied to Android projects`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation&lt;/CODE&gt;&amp;nbsp;ID must be applied in the&amp;nbsp;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://dt-url.net/top-level-build-file" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;top-level build file&lt;/A&gt;&amp;nbsp;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&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Perform the steps in this topic before you begin instrumenting your app with the Dynatrace Android Gradle plugin." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-first-steps" target="_self" data-testid="link"&gt;Instrument your application via Dynatrace Android Gradle plugin&lt;/A&gt;&amp;nbsp;for the detailed instructions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;Why do I see the message `The Dynatrace Android Gradle plugin can't be directly applied to a Java- or Android-related module`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P class="sc-gEvEer lcacrh sc-kAyceB kaaxKv sc-3b06fd1c-0 ivrEIu" data-testid="paragraph"&gt;Your project does not use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-gsFSXq dMCrLH sc-2d500c67-0 sc-68987768-1 gPHVzu bsktS" href="https://developer.android.com/studio/build#build-files" target="_blank" rel="noopener noreferrer" data-testid="external-link"&gt;recommended architecture&lt;/A&gt;; it uses an uncommon project architecture.&lt;/P&gt;
&lt;DIV class="sc-6646062a-0 ivCgmd"&gt;
&lt;UL class="sc-jEACwC hZeaxZ"&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;If your Android project contains only one build file, follow the steps in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures#one-build-file" target="_self" data-testid="link"&gt;Projects with one build file&lt;/A&gt;.&lt;/LI&gt;
&lt;LI class="sc-cPiKLX cTTNHO"&gt;For other project architectures, check&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures" target="_self" data-testid="link"&gt;Change Dynatrace Android Gradle plugin configuration based on the project structure&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or contact a Dynatrace product expert via live chat.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;
&lt;H2&gt;&lt;SPAN&gt;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`?&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;The plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation&lt;/CODE&gt;&amp;nbsp;ID automatically configures all modules in your project. Therefore, you don't need to use the plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation.module&lt;/CODE&gt;&amp;nbsp;ID. See&amp;nbsp;&lt;A class="sc-iGgWBj bKeKTL sc-68987768-0 eSCioX" title="Use the Dynatrace Android Gradle plugin for less common project architectures." href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-uncommon-architectures" target="_self" data-testid="link"&gt;Change Dynatrace Android Gradle plugin configuration based on the project structure&lt;/A&gt;&amp;nbsp;to understand when you should use the plugin with the&amp;nbsp;&lt;CODE class="sc-gEvEer fFVnlo sc-eqUAAy bQBxQO" data-testid="code"&gt;com.dynatrace.instrumentation.module&lt;/CODE&gt;&amp;nbsp;ID.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can't resolve a build problem with the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/dynatrace-android-gradle-plugin-overview" target="_self" rel="noopener noreferrer"&gt;Dynatrace Android Gradle plugin&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;used for your mobile applications, please contact a Dynatrace product expert via live chat within your Dynatrace environment and&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.dynatrace.com/docs/shortlink/android-logging-oneagent" target="_self" rel="noopener noreferrer"&gt;provide&amp;nbsp;the logs&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For general issues, refer to&amp;nbsp;&lt;A href="https://community.dynatrace.com/t5/Troubleshooting/Mobile-applications-General-issues-with-Dynatrace-Android-Gradle/ta-p/234748" target="_self"&gt;Mobile applications: General issues with Dynatrace Android Gradle plugin&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 May 2024 16:23:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Mobile-applications-Build-issues-with-Dynatrace-Android-Gradle/ta-p/234750</guid>
      <dc:creator>maliborskaya</dc:creator>
      <dc:date>2024-05-09T16:23:46Z</dc:date>
    </item>
  </channel>
</rss>

