Garmaine Staff asked 2 years ago

I am following a course for unity 3d, and am attempting to build my project for android. I am using Unity version 2019.3.9f1.

The build fails when creating a gradle project, but I am a complete beginner and have no idea what "grade" even means. Heres what the unity console prints out.

CommandInvokationFailure: Gradle build failed. D:/Programs/Unity/Editor/2019.3.9f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Programs\Unity\Editor\2019.3.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':launcher:processReleaseResources'.

    Android resource linking failed D:\Programs\Unity\Projects\Unity3dCourse\AndTest\Temp\gradleOut\launcher\build\intermediates\incremental\mergeReleaseResources\merged.dir\values-v28\values-v28.xml:4: AAPT: error: style attribute 'android:attr/windowLayoutInDisplayCutoutMode' not found.

    error: failed linking references.

  • 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 15s ] stdout[

Task :unityLibrary:preBuild UP-TO-DATE Task :launcher:preBuild UP-TO-DATE Task :unityLibrary:preReleaseBuild UP-TO-DATE Task :launcher:prepareLintJar Task :unityLibrary:checkReleaseManifest Task :unityLibrary:processReleaseManifest Task :unityLibrary:compileReleaseAidl NO-SOURCE Task :unityLibrary:packageReleaseRenderscript NO-SOURCE Task :unityLibrary:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseBuildConfig Task :unityLibrary:generateReleaseResValues Task :unityLibrary:generateReleaseResources Task :launcher:preReleaseBuild Task :launcher:compileReleaseAidl NO-SOURCE Task :launcher:compileReleaseRenderscript NO-SOURCE Task :launcher:checkReleaseManifest Task :launcher:generateReleaseBuildConfig Task :launcher:generateReleaseSources Task :launcher:mainApkListPersistenceRelease Task :launcher:generateReleaseResValues Task :launcher:generateReleaseResources Task :launcher:createReleaseCompatibleScreenManifests Task :unityLibrary:packageReleaseResources Task :launcher:processReleaseManifest Task :unityLibrary:generateReleaseRFile Task :unityLibrary:prepareLintJar Task :unityLibrary:generateReleaseSources Task :unityLibrary:javaPreCompileRelease Task :launcher:mergeReleaseResources Task :launcher:processReleaseResources FAILED Task :unityLibrary:compileReleaseJavaWithJavac

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '–warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings 19 actionable tasks: 19 executed ]

exit code: 1

UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)

UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)

UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)

UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at :0)

UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :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 :0)

UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)

UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :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 :0)

UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :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 :0)

UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :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 :0)