Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

gradle build failed

Discussion in 'Scripting' started by enemali, Nov 28, 2021.

  1. enemali

    enemali

    Joined:
    May 29, 2017
    Posts:
    17
    please how can i fix this error
    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed.
    2. C:/Program Files/Unity/Hub/Editor/2019.4.33f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.4.33f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
    3.  
    4. stderr[
    5.  
    6. FAILURE: Build failed with an exception.
    7.  
    8. * Where:
    9. Build file 'C:\Users\mali\Desktop\1\Build 2_ AutismVR\Temp\gradleOut\launcher\build.gradle' line: 3
    10.  
    11. * What went wrong:
    12. A problem occurred evaluating project ':launcher'.
    13. > Failed to apply plugin [id 'com.android.application']
    14.    > Cannot parse project property android.enableR8='' of type 'class java.lang.String' as boolean. Expected 'true' or 'false'.
    15.  
    16. * Try:
    17. 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.
    18.  
    19. * Get more help at https://help.gradle.org
    20.  
    21. BUILD FAILED in 1m 39s
    22. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    23. ]
    24. stdout[
    25. Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
    26. ]
    27. exit code: 1
    28. UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    29. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    30. UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    31. UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    32. UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    33. Rethrow as GradleInvokationException: Gradle build failed
    34. UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    35. UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    36. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    37. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    38. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    39. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    40. 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 <a62274e3cf264793ab003fc3e81fb523>:0)
    41. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <a62274e3cf264793ab003fc3e81fb523>:0)
    42. 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 <3d6d6a4a6d7c4ec2aa654b7d8f54a096>:0)
    43. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    44.  
     
  2. yishengabcd

    yishengabcd

    Joined:
    Oct 8, 2020
    Posts:
    2
    Has it been solved?
     
  3. enemali

    enemali

    Joined:
    May 29, 2017
    Posts:
    17
    i had to use an older version of unity to build for android 6.
    The problem occurred while using the current version of unity to build for android 6
     
  4. yishengabcd

    yishengabcd

    Joined:
    Oct 8, 2020
    Posts:
    2
    I use unity 2020 no problem, downgraded to unity 2019 error