I updated to AndroidStudio 3.3 which now gives a warning about deprecated libraries:
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 https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. Affected Modules: app
There is some more info provided at their web site:
but I don't exactly understand it. They say:
To see the additional info, you need to include the following in your project's gradle.properties file:
android.debug.obsoleteApi=true
So I took the build.gradle that is marked with (Project: [my project])
The document looks like this:
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 ->
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()
}
However, I don't understand, where I should add that line now. And no matter where I put it, I always get an error.
E.g. when writing it directly in the first line:
Could not get unknown property 'android' for root project [my project] of type org.gradle.api.Project.
So where is this supposed to be added? Or am I mixing the definitions of "Project" and "app" for the gradle files?