I am trying to upgrade gradle version and plugin version in my project. I have gradle 4.1 and plugin 3.2. After going through hundreds of errors I am stuck with that one: incremental out directory should be set to aar output directory. This error occurs org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ModuleLibrary:compileDebugJavaWithJavac'.
I tried clearing cache, restarting android studio. In fact I didn't come across similar issue.
This is gradle output of my project (root):
applicationVariants.all { variant ->
variant.outputs.all { output ->
def relativeRootDir = output.packageApplication.outputDirectory.toPath()
.relativize(rootDir.toPath()).toFile()
output.outputFileName = new File("$relativeRootDir/release", defaultConfig.versionName + ".apk")
}
}
And this is gradle output of my ModuleLibrary:
libraryVariants.all { variant ->
variant.outputs.all { output ->
if (outputFile != null && outputFileName.endsWith('.aar')) {
outputFileName = new File("${archivesBaseName}-${defaultConfig.versionName}.aar")
}
}
}
I have one warning when doing sync about 'compile' being obsolete but I cannot find the missing one. I think I changed all of them for implementation. I tried changing all 'implementation' for 'api' but no changes. Anyone has that problem? Please help!