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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

CommandInvokationFailure: Gradle build failed

Discussion in 'Editor & General Support' started by sulanhava, Apr 21, 2018.

  1. sulanhava

    sulanhava

    Joined:
    Mar 4, 2018
    Posts:
    4
    Can someone help me ? Since yesterday i have some problems to build apk. I already uninstall and reinstall Unity and Android Studio. Tryed 8 - 10 JDK's.

    This are my Errors:


    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Java/jdk1.8.0_151\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2017.4.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"

    stderr[
    AAPT err(Facade for 1356758566): \\?\C:\Users\OneDrive\Desktop\Unity Projekte\Frogger Replica\Temp\gradleOut\build\intermediates\res\merged\release\drawable-xhdpi\app_banner.png ERROR: Unable to open PNG file
    AAPT err(Facade for 175107892): \\?\C:\Users\OneDrive\Desktop\Unity Projekte\Frogger Replica\Temp\gradleOut\build\intermediates\res\merged\release\drawable-mdpi\app_icon.png ERROR: Unable to open PNG file

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':mergeReleaseResources'.
    > Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED in 4s
    ]
    stdout[
    NDK is missing a "platforms" directory.
    If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\AppData\Local\Android\Sdk\ndk-bundle.
    If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

    The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
    The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
    The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
    :preBuild UP-TO-DATE
    :preReleaseBuild UP-TO-DATE
    :checkReleaseManifest
    :prepareReleaseDependencies
    :compileReleaseAidl
    :compileReleaseRenderscript
    :generateReleaseBuildConfig
    :generateReleaseResValues
    :generateReleaseResources
    :mergeReleaseResources
    Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
    :mergeReleaseResources FAILED
    7 actionable tasks: 7 executed
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    Rethrow as GradleInvokationException: Gradle build failed
    UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  2. mkg2w

    mkg2w

    Joined:
    Aug 19, 2013
    Posts:
    49
    Were you able to resolve this issue ?