R
R
Roman Izumrudov2021-07-27 23:52:22
Android
Roman Izumrudov, 2021-07-27 23:52:22

I created a simple project on Unity and ran into a problem that when compiling an apk file, an error occurs, how to fix it?

Total 4 mistakes
1)


FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\sobol\OneDrive\Desktop\unity\clicker.v4\Temp\gradleOut\launcher\build.gradle' line: 3

* What went wrong:
A problem occurred evaluating project ':launcher '.
> Failed to apply plugin [id 'com.android.internal.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 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,bool&)

2)
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2020.3.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2020.3.14f1\ Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\sobol\OneDrive\Desktop\unity\clicker.v4\Temp\gradleOut\launcher\build.gradle' line: 3

* What went wrong:
A problem occurred evaluating project ':launcher '.
> Failed to apply plugin [id 'com.android.internal.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 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 <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.ProcessToExit psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android .Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor .Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <1f5aacfb83804e518b48285b5fe58926>: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 <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostContext) <1f5aacfb83804e518b48285b5fe58926>: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 <1f5aacfb83804e518b48285b5fe58926>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <
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 <1f5aacfb83804e518b48285b5fe58926>: 0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs the args, UnityEditor.BuildProperties & outProperties) (AT <1f5aacfb83804e518b48285b5fe58926>: 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 <25e9afc147634a5ca855ab83fab425dd>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

3)
Build completed with a result of 'Failed' in 25 seconds (24999 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

4)
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <25e9afc147634a5ca855ab83fab425dd>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods(System.Boolean askForBuildOptions)defaultBuildMethods(System.Boolean askForBuildOptions) [0x00080] in <25e9afc147634a5ca855ab83fab425dd>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I have 2 scripts, main script and sound
script
https://pastebin.com/sMAuicqi

Sound script
https://pastebin .com/qpZc2hQ6

1)
61006e6c52846672194801.png
2)
61006ec95ab16974000237.png
3)
61006ed957c47149034805.png
If I wrote something wrong or something was superfluous, then I apologize in advance to everyone who wants to help, I first ask a question on the forum.
and if you suddenly need some more information, then write, I will provide everything that is required, just to solve the problem

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LeiksGames, 2021-07-27
@Pelemexa

in the third where jdk android.
In short, go to installs in the unity hub, and where the android is, click on the arrow and install 2 utilities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question