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

CommandInvokationFailure: Gradle build failed. Potential Solution

Discussion in 'Editor & General Support' started by Dan_Meme, Mar 28, 2018.

  1. Dan_Meme

    Dan_Meme

    Joined:
    Jul 28, 2014
    Posts:
    1
    Dear Unity Community,

    I just wanted to make a quick post that covered the Error I have had when Building to an Andriod phone.

    "CommandInvokationFailure: Gradle build failed. "
    Error.JPG
    Previously I had unnecessary levels of the Unity SDKs installed on my work pc, which took a lot of Disc Space. As SDKs are often backwards compatible I reinstalled Andriod studio and JDK 8. There was 1 major issue where within my windows registry my username had a space. Unity and Android does not like installing SDKs to a file location with a space in the file directory.

    So when I did the new install I installed everything on the C: Drive under a folder called "Android". This created an Error within Unity when Building to a Phone. To ensure that you can build to a Phone I advise you to check;

    1. That there is an SDK installed to the appropriate API level.
    2. Make sure you have JDK 8.0
    3.Check the Directories within Unity( Use Unity Edit>Preferences>ExternalTools and make sure the directory is correct.)
    External Tools.JPG

    I hope this helps.
    Kind Regards,
    Dan
     
  2. TalhaDX

    TalhaDX

    Joined:
    Feb 2, 2013
    Posts:
    94
    Here is a more active thread for this question LINK