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

Error when builden apk

Discussion in 'General Discussion' started by xasa7980, Sep 14, 2022.

  1. xasa7980

    xasa7980

    Joined:
    Oct 28, 2020
    Posts:
    3
    Hello,
    I get some errors when I try to build an apk from a proyect I made and i don't know what more can I do, i checked everything and its my first time to write here.. The errors are..

    Error 1:
    FAILURE: Build failed with an exception.

    * Where:
    Build file 'C:\Users\dismo\OneDrive\Escritorio\unity\Xavi\Tareas\Tarea módulo 4\EjemploMuseoTokyo\shoter ship\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
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    UnityEngine.GUIUtility:processEvent (int,intptr)

    Error 2:

    CommandInvokationFailure: Gradle build failed.
    C:/Program Files/Unity/Hub/Editor/2019.4.40f1/Editor/Data/PlaybackEngines/AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.4.40f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

    stderr[

    FAILURE: Build failed with an exception.

    * Where:
    Build file 'C:\Users\dismo\OneDrive\Escritorio\unity\Xavi\Tareas\Tarea módulo 4\EjemploMuseoTokyo\shoter ship\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
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[

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

    Error 3:
    Build completed with a result of 'Failed' in 25 seconds (24803 ms)

    Error 4:

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bf] in <7105be432fb64891b07085914e6cd5c1>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <7105be432fb64891b07085914e6cd5c1>:0
    UnityEngine.GUIUtility:processEvent (int,intptr)

    UnityEngine.GUIUtility:processEvent (int,intptr)
     
  2. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,372
    I'd try remedeing the above and trying again.
     
  3. xasa7980

    xasa7980

    Joined:
    Oct 28, 2020
    Posts:
    3
    Yeah I have checked it for a long time but haven't seen any solution, i do not understand what does it means that my project path does not contain ASCII characters, mostly everything on a keyboard are ASCII characters if I am not wrong. And I also have tried to build the project a few times more and i get the same errors but nothing different
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,337
    Nope.
    ASCII characters, simply put, mean "english uppercase and lowercase letters, numbers, and underscore".
    There's more of them, but many of them can't be used in filenames.
    upload_2022-9-15_2-24-27.png
    In your example, this is not an ascii character:
    "ó" (o-acute). It is part of "Tarea módulo 4"
     
    Amon likes this.
  5. xasa7980

    xasa7980

    Joined:
    Oct 28, 2020
    Posts:
    3
    Wow, I made it! I cannot believe it was such a silly thing, I am so thanksful, now it give's me another error when i try to update sdk for upgrade api level with my powershell :'(