S
S
Shameless192019-10-30 18:19:47
Android
Shameless19, 2019-10-30 18:19:47

How to compile a unity project?

Can't compile android project into apk file. How to fix? 5db9a9b4b4c94072875249.png5db9a9c055de3343435149.png5db9a9cfe2ae6179394920.png
Error text:
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
at UnityEditor. BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
1)
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
/ tried to replace the tools folder in the android sdk with an older version folder, but the error remained.
2)
CommandInvokationFailure: Gradle build failed.
C:\Games\Unity\2018.4.9f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Games\Unity\2018.4.9f1\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\�\Desktop\PT\UnityVersion\PT\Temp\gradleOut\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> 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 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 7s
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor .Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at :0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at :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 :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor .Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
/How to fix the error without changing the name of the admin folder? For this devil does not want to succumb to change

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Algorithm_00, 2019-10-31
@Shameless19

This happened to me when I checked the "Custom Gradle Template" checkbox in publish settings when Ui builds app bundle - that's me talking about the first Error.
Also, as they say on foreign forums - "this arises due to outdated animation", although, alas, I did not understand the meaning of their words.
In general, it would not be bad to transfer the project to a newer version, at least to 5.6f, of course I don’t know (you didn’t specify, but it seems like you have an older one)
It happens that I built on a 4096x4096px terrain and got the same error. I couldn't even open my project. It turned out that lighting and shadow require too much memory. Solution: Edit (top left) -> Settings -> GI Cache -> Clear Cache.
But then I had to continue working on smaller terrain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question