Gradle disable all incremental compilation and parallel builds

Parrallel building is not enabled by default in Gradle. That said, in order to explicitly disable parrallelism, you can add

org.gradle.parallel=false

to your project's gradle.properties file or specify the --no-parallel option to the gradle/gradlew command that initiates the build.


Important note here, is that for certain versions of Gradle, like 4.6 and 4.7 and others, disabling parallel execution did not work. A workaround is to specify a very limited number of worker threads. By default the max worker threads are equal to the number of your system's processors.

So in the project's gradle.properties add the value

org.gradle.workers.max=1

in order to limit the number of concurrent worker threads to 1 or specify the option --max-workers=1 to the gradle/gradlew command that initiates the build.


In versions prior to Gradle 4.10, incremental building is not enabled by default. For versions after 4.10, you can add the following to your build.gradle (most probably to the top-level one in a multi-module project) in order to disable incremental Java compilation:

tasks.withType(JavaCompile) {
    options.incremental = false
}

Try to add

org.gradle.daemon=false
org.gradle.parallel=false

to the gradle.properties file, it can help you in your problem.