Cannot Build Android Application

I am using the 2019.1.6 version. I got this error when I trying to build my app. Can you please help me to solve this. This is an urgent project. :frowning:

CommandInvokationFailure: Gradle build failed.
E:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “E:\2019.1.6f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx98304m” “assembleRelease”
stderr[
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:packageRelease’.

org.gradle.tooling.BuildException (no error message)

  • 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 28m 49s
    ]
    stdout[
    :checkReleaseClasspath UP-TO-DATE
    :preBuild UP-TO-DATE
    :preReleaseBuild UP-TO-DATE
    :compileReleaseAidl NO-SOURCE
    :compileReleaseRenderscript UP-TO-DATE
    :checkReleaseManifest UP-TO-DATE
    :generateReleaseBuildConfig UP-TO-DATE
    :prepareLintJar UP-TO-DATE
    :mainApkListPersistenceRelease UP-TO-DATE
    :generateReleaseResValues UP-TO-DATE
    :generateReleaseResources UP-TO-DATE
    :mergeReleaseResources UP-TO-DATE
    :createReleaseCompatibleScreenManifests UP-TO-DATE
    :processReleaseManifest
    :splitsDiscoveryTaskRelease UP-TO-DATE
    :processReleaseResources
    :generateReleaseSources
    :javaPreCompileRelease UP-TO-DATE
    :compileReleaseJavaWithJavac UP-TO-DATE
    :compileReleaseNdk NO-SOURCE
    :compileReleaseSources UP-TO-DATE
    :lintVitalRelease
    :mergeReleaseShaders UP-TO-DATE
    :compileReleaseShaders UP-TO-DATE
    :generateReleaseAssets UP-TO-DATE
    :mergeReleaseAssets
    :transformClassesWithDexBuilderForRelease UP-TO-DATE
    :transformDexArchiveWithExternalLibsDexMergerForRelease UP-TO-DATE
    :transformDexArchiveWithDexMergerForRelease UP-TO-DATE
    :mergeReleaseJniLibFolders UP-TO-DATE
    :transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
    :checkReleaseLibraries UP-TO-DATE
    :processReleaseJavaRes NO-SOURCE
    :transformResourcesWithMergeJavaResForRelease UP-TO-DATE
    :validateSigningRelease UP-TO-DATE
    :packageRelease FAILED
    28 actionable tasks: 5 executed, 23 up-to-date
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <4132c5c2cd7b45b09ef33302ae416489>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1[T] progress) (at <4132c5c2cd7b45b09ef33302ae416489>: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 <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>: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 <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>: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 <4132c5c2cd7b45b09ef33302ae416489>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <4132c5c2cd7b45b09ef33302ae416489>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Hello there! First, we recommend upgrading to 2019.4 LTS as that is the supported version for our 2019 releases.

Second, which platform are you targeting? If you are targeting ARCore, you’ll need to update gradle (see ARCore documentation https://developers.google.com/ar/develop/unity/android-11-build)

1 Like

I am using google VR for Unity

Thanks! So, connected with the team on this, and this was the guidance they had:

Google Daydream is no longer supported as Google deprecated the platform. If you are targeting Cardboard, make sure you’re using the open-source plugin released by Google. Feel free to share feedback with them directly here.

Your specific issue may still be related to updating gradle. It’s worth looking at this page.