title: Android Gradle - Where to add "android.debug.obsoleteApi=true"
body: <p>I updated to AndroidStudio 3.3 which now gives a warning about deprecated libraries:</p>
  
  <blockquote>
    <p>WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and
    has been replaced with 'variant.getExternalNativeBuildProviders()'. It
    will be removed at the end of 2019. For more information, see
    <a href="https://d.android.com/r/tools/task-configuration-avoidance" rel="noreferrer">https://d.android.com/r/tools/task-configuration-avoidance</a>. To
    determine what is calling variant.getExternalNativeBuildTasks(), use
    -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. Affected Modules: app</p>
  </blockquote>
  
  <p>There is some more info provided at their web site:</p>
  
  <p><a href="https://developer.android.com/studio/releases/gradle-plugin?utm_source=android-studio#behavior_changes" rel="noreferrer">https://developer.android.com/studio/releases/gradle-plugin?utm_source=android-studio#behavior_changes</a></p>
  
  <p>but I don't exactly understand it. They say:</p>
  
  <blockquote>
    <p>To see the additional info, you need to include the following in your
    project's gradle.properties file:</p>
    
    <p>android.debug.obsoleteApi=true</p>
  </blockquote>
  
  <p>So I took the build.gradle that is marked with (Project: [my project])</p>
  
  <p>The document looks like this:</p>
  
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.10'
      repositories {
          jcenter()
          maven {
              url 'https://maven.google.com/'
              name 'Google'
          }
          google()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.0'
          classpath 'com.google.gms:google-services:4.0.1'
          classpath 'com.github.triplet.gradle:play-publisher:1.1.5'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          maven {
              url "https://jitpack.io"
          }
          mavenCentral()
      }
  }
  
  project.ext.preDexLibs = !project.hasProperty('disablePreDex')
  
  subprojects {
      project.plugins.whenPluginAdded { plugin -&gt;
          if ("com.android.build.gradle.AppPlugin" == plugin.class.name) {
              project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
          } else if ("com.android.build.gradle.LibraryPlugin" == plugin.class.name) {
              project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
          }
      }
  }
  repositories {
      mavenCentral()
  }
  </code></pre>
  
  <p>However, I don't understand, where I should add that line now. And no matter where I put it, I always get an error.</p>
  
  <p>E.g. when writing it directly in the first line: </p>
  
  <blockquote>
    <p>Could not get unknown property 'android' for root project [my project]
    of type org.gradle.api.Project.</p>
  </blockquote>
  
  <p>So where is this supposed to be added? Or am I mixing the definitions of "Project" and "app" for the gradle files?</p>