13 Mar 2025
05:07 PM
- last edited on
17 Mar 2025
11:56 AM
by
MaciejNeumann
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.3.1'
classpath 'com.dynatrace.tools.android:gradle-plugin:8.+'
}
}
plugins {
id 'com.android.application' version '8.3.1' apply false
id 'com.android.library' version '8.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.9.23' apply false
id 'com.dynatrace.instrumentation' version '8+' apply true
}
apply plugin: 'com.dynatrace.intrumentation'
dynatrace {
configurations {
mainConfig {
autoStart {
applicationId 'xxx'
beaconUrl 'xxx'
}
userOptIn false
agentBehavior.startupLoadBalancing true
sessionReplay.enabled false
}
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
14 Mar 2025 09:08 AM
You have a typo in the apply statement. The "s" is missing in "instrumentation"
apply plugin: 'com.dynatrace.instrumentation'
You are also adding the plugin two times: Via the "plugins" block and via the apply statement.
I would recommend to only add the Dynatrace Android Gradle plugin once. You can either use
plugins {
id 'com.dynatrace.instrumentation' version '8.+'
}
or
buildscript {
...
dependencies {
classpath 'com.dynatrace.tools.android:gradle-plugin:8.+'
}
}
apply plugin: 'com.dynatrace.instrumentation'