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

Android build failed

Discussion in 'Android' started by ReikoTennosaar, Jan 1, 2020.

  1. ReikoTennosaar

    ReikoTennosaar

    Joined:
    Oct 12, 2019
    Posts:
    5
    I am trying to make an android game (simple infinite runner) but when i am trying build and run i get an error "Gradle build failed. See the console for details" and when i check the console i have a lot of errors

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    FAILURE: Build failed with an exception.

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Build file 'C:\Users\reixt\Desktop\Esimene M�ng\Temp\gradleOut\launcher\build.gradle' line: 3

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    * What went wrong:

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    A problem occurred evaluating project ':launcher'.

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    > Failed to apply plugin [id 'com.android.application']

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    * Try:

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    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.

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    * Get more help at https://help.gradle.org

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    BUILD FAILED in 1s

    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.3.0f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.3.0f1\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.

    * Where:
    Build file 'C:\Users\reixt\Desktop\Esimene M�ng\Temp\gradleOut\launcher\build.gradle' line: 3

    * What went wrong:
    A problem occurred evaluating project ':launcher'.
    > Failed to apply plugin [id 'com.android.application']
    > Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.

    * 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 1s
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <5b6dae0b592a492ba620e07746542d5c>: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 <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5b6dae0b592a492ba620e07746542d5c>: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 <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5b6dae0b592a492ba620e07746542d5c>: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 <5b6dae0b592a492ba620e07746542d5c>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5b6dae0b592a492ba620e07746542d5c>: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 <3b74787e58694cdda2c241162159b3b7>:0)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Build completed with a result of 'Failed'
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    UnityEditor.BuildPlayerWindow+BuildMethodException: 19 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in <3b74787e58694cdda2c241162159b3b7>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <3b74787e58694cdda2c241162159b3b7>:0
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

    Okay i know there is so many of errors and i problably wont get help because noone would like to help a stupid guy with so many errors but when i am doing a build for windows everything works fine. sdk and jdk are also downloaded with unity. Thanks if someone tries to help me :)
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    Your project path is 'C:\Users\reixt\Desktop\Esimene M�ng\Temp\gradleOut\launcher\build.gradle' line: 3

    it contains non ASCII symbols, remove those symbols
     
  3. ReikoTennosaar

    ReikoTennosaar

    Joined:
    Oct 12, 2019
    Posts:
    5
    Now it works!
     
  4. dfsimo07

    dfsimo07

    Joined:
    Aug 11, 2021
    Posts:
    2
    Ciao, di sicuro non mi risponderai però come hai fatto a togliere quei simboli ASCII, perché io ho ritrovato lo stesso problema. aspetto una tua risposta grazie!.
     
  5. individualbasketball1681

    individualbasketball1681

    Joined:
    Aug 9, 2021
    Posts:
    4
    I didn't understand!
     
  6. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    824
    I used google translate to figure out what you ask. Move the project to a different location, which has only ASCII symbols. If your project directory has some of them, you will have to rename project directory as well.
     
  7. dfsimo07

    dfsimo07

    Joined:
    Aug 11, 2021
    Posts:
    2
    Grazie mille!!!!!