error build - Starting a Gradle Daemon, 1 incompatible Daemon could not be reused,

Hello,

The build of my Android game was working very well, but after I came back from vacation it doesn’t work anymore. I updated Gradle and my SDK too, but I still have the same error!

Can you help me?

error :

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details > Configure project :launcher WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. > Configure project :unityLibrary WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. > Configure project :unityLibrary:GooglePlayGamesManifest.androidlib WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34 This Android Gradle plugin (7.0.2) was tested up to compileSdk = 31 This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 34 Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2020.3.35f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Project\gradle-8.3\lib\gradle-launcher-8.3.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" stderr[ Warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. Warning: élément inattendu (URI : "", local : "extension-level"). Les éléments attendus sont <{}codename>,<{}layoutlib>,<{}api-level> Warning: élément inattendu (URI : "", local : "base-extension"). Les éléments attendus sont <{}codename>,<{}layoutlib>,<{}api-level> FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':launcher:compileReleaseJavaWithJavac'. > Could not resolve all dependencies for configuration ':launcher:releaseCompileClasspath'. > Could not create task ':unityLibrary:processReleaseManifest'. > Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 8s Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 ] stdout[ Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details > Configure project :launcher WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. > Configure project :unityLibrary WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. > Configure project :unityLibrary:GooglePlayGamesManifest.androidlib WARNING:Using flatDir should be avoided because it doesn't support any meta-data formats. WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34 This Android Gradle plugin (7.0.2) was tested up to compileSdk = 31 This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 34 Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. ] exit code: 1 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <b6530713c8564225834b4768bc10f776>:0) Rethrow as GradleInvokationException: Gradle build failed UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b6530713c8564225834b4768bc10f776>:0) Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <b6530713c8564225834b4768bc10f776>:0) UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <bfe26bbc7be749c7bb22d52435e15888>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
1 Like

How to troubleshoot build failures:

First, make a blank project with a single blank scene and prove that it builds successfully.

If the blank project does NOT build, go fix your Unity installation or your other tools, such as Android SDK, NDK, JDK, etc. It may even be necessary to change to a different version of Unity3D. It is generally best to stay with LTS versions of Unity3D.

Until you can build a blank project to the target platform, don’t fiddle with anything else.

Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

Most often things that prevent building are third-party libraries such as Firebase.

Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

It may also be helpful to work through a tutorial or two for whatever subsystem is making the build fail.

Android build not building:

Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.

Here was how I brought up Unity2020.3.41 and the Android SDK 31 on October 30, 2022 (edited on August 23, 2023 to include Android SDK 33…):

Android Gradle errors and other related stuff:

I got this error after updating to Unity 2022.3.23f1 in my android build.

I found out that this is because in my previous unity version I had given the path to my own downloaded gradle folder in Edit > Preferences > External Tools.

I reverted back to Gradle installed with unity and this fixed the build error.

Just thought I should add this in for someone also struggling with the same issue :slight_smile:

4 Likes

I found out that this is because in my previous unity version I had given the path to my own downloaded gradle folder in Edit > Preferences > External Tools.

I changed my project from Unity 2021.2.14f1 to 2022.3.9f1 and noticed that the SDK version in the 2021 folder was 30.0.2, while in the 2022 folder it was 32.0.0. This resolved the issue.