Unity editor build player window ошибка

Unity Discussions

Loading

background

We are creating a VR application for smartphones.
At that time, when I tried to build it for Android, it didn’t work and it took quite a while to solve.
I’ve tried a few things to do, so I’m going to show you.

The following errors occurred:

UnityException: No Android devices connected
Make sure your device is plugged in.
If you are sure that the device is attached then it might be USB driver issue, for details please check 'Android environment setup' section in Unity manual.
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Build completed with a result of 'Failed'
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
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 
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

image.png

environment

  • Windows 10
  • Unity 2019.1.5f1
  • Android Studio Version 3.2.1

1. Run Unity as Administrator & Build (no effect)

Right-click on Unity → click Run as administrator to open the appropriate project.
And Build And Run.
The error content remains the same.

2. Upgrade Unity (no effect)

Update Unity to the latest version.
The error content remains the same.

3. Downgrade Unity (no effect)

I downgraded to Unity 2018.3.1f1 and tried to build.
The error content remains the same.

4. Windows 10 update (no effect)

Check Windows Update → Windows Update for updates → settings.
There is nothing to update, and the situation has not changed.

5.C: Build to \\Users[name]\\Documents folder (no effect)

I was trying to create an apk in C:\\Users[name]\\Desktop, so I changed it to under the Documents folder.
The error content remains the same.

6. Reduce the Minimum API Level (no effect)

I tried lowering it from Android 7.1 (API Level 25) to Android 5.0 (API Level 20).
The error content remains the same.

7. Delete .sln files in the project’s folder (no effect)

Move .sln files to the Trash.
The error content remains the same.
(Be sure to back it up and put it back in when you’re done.) )

8. Turn on Android USB debugging

The Android I was using was not in debug mode.
The following will be very helpful.
Android: Set up a USB driver to debug apps on a real device

Once I turned on USB debugging, I was able to build it safely.

Postscript

I completely forgot that I turned off USB debugging on Android.
I wondered if it was because I had updated Unity all the time, and I was trying to deal with it that was off the mark.
I was keenly aware that Unity’s error investigation ability is still a long way off.

bibliography

Unity cannot build|teratail
Unable to build my projects in 2018.2.0b7 after receiving fatal build error

If you are facing the error “UnityEditor.BuildPlayerWindow+BuildMethodException:” while building in unity, then this guide is for you. This error occurs when Unity is unable to build the project due to some issue in the code or the settings.

Here are some steps you can follow to fix this issue:

1. Check Your Code

The first step is to check your code for any errors. Make sure that there are no syntax errors or missing references. Also, check for any warnings that may be indicating a potential issue.

For example, if you are using a plugin or library, make sure that it is imported correctly and all the required files are present.

2. Check Build Settings

Another reason for this error could be incorrect build settings. Make sure that the platform is set correctly and that all the required scenes are added to the build settings.

To check the build settings, go to File -> Build Settings. Here, you can add or remove scenes and select the target platform.

3. Update Unity

If you are using an older version of Unity, try updating to the latest version. The newer versions of Unity have bug fixes and improvements that may help resolve this issue.

4. Disable Anti-Virus

Sometimes, the Anti-Virus program can interfere with the build process and cause this error. Try disabling the Anti-Virus temporarily and see if the build completes successfully.

5. Contact Unity Support

If none of the above steps work, it’s best to contact Unity Support. They can provide additional assistance and help you troubleshoot the issue.

Here is an example of the error message:

UnityEditor.BuildPlayerWindow+BuildMethodException: 
Error building Player because scripts have compile errors in the editor

In this case, you need to check your code for any syntax errors or missing references.

I hope this guide helps you fix the “UnityEditor.BuildPlayerWindow+BuildMethodException:” error in Unity.

I. Error reporting content:
(Sometimes 49 mistakes, then 19 again. Here’s the last one each time.)

UnityEditor. BuildPlayerWindow + BuildMethodException: 19 errors at UnityEditor. BuildPlayerWindow + DefaultBuildMethods. BuildPlayer (UnityEditor. BuildPlayerOptions options) in x00242 [0]
D:\unity\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
The at UnityEditor. BuildPlayerWindow. CallBuildMethods (System. Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in D:\unity\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

(There is also an error message that differs from other error messages,Gradle is a Unity packaging related tool)

CommandInvokationFailure: Gradle build failed.

 
Two. Solutions
The following four methods are all found by querying the data:
(None of the four approaches successfully solved my problem, but a similar BuildPlayerWindow+BuildMethodException error might occur if you don’t follow these Settings, where the number of errors might be different):

Method 1: File-buildsetting-PlayerSetting-Player-otherSettings-AndroidTVCompatibility disabled (Individual tried not to work)
Method 2: The release path cannot include Chinese, the path cannot be in the project, try to change the path, the release directory is placed in the same level directory as the project (individual tried, but it does not work)
Method 3: File-buildsettings-PlayerSetting-API Compatibility Level Choose Net 2.0(personal try does not work)
Step 4: Remove the plugins folder from the project’s “Assets” folder. I left a plugins/ vscode.cs in my project (I tried it personally but it didn’t work)

Tips for personal success:

Method 5: The name of the file-buildsetting-playersetting-player-productname is the same as the apK name after the file-buildsetting-build (my problem is that I try to change the following to send the package normally)

 

Three. I refer to the UNITY of the android package transmission gate configuration tutorial: https://blog.csdn.net/ChinarCSDN/article/details/79513403
There is also a portal for the error reporting solution of the great God, but I tried that my error reporting was not for this reason, so I failed to solve it.
The software version I used was different, because the time interval was long, so I used JDK-Java SE 8U231 version and SDK-3.5.2 version.

Read More:

I am getting the following error when trying to build for PC/Windows:

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

I have googled this issue, and the answers I found were:

  1. Re-import all assets
  2. Remove the .sln files (Visual Studio solution files) from your project
  3. Change the build folder to outside the project
  4. Remove the Plugins folder from the Assets folder

I did 1-3 and the problem remains. #4 doesn’t make since, because I have plugins which are required in that folder.
The project is compiling and running inside Unity, but it just won’t build.

My Unity version is 2018.3.4f1, if that helps…

Can you please advice? This is extremely frustrating and I am fighting this over 2 days now

Понравилась статья? Поделить с друзьями:
  • Unity 2019 ошибка при запуске
  • Unique constraint violated oracle ошибка
  • Unifr dll 3651 ошибка 200 логическая ошибка 0xc8
  • Uniel rs 1 1500 ошибка
  • Unidrive ошибка t071