Unity error building player because scripts had compiler errors

Error building player because scripts had compiler errors Every time i try to build my game. I get an error: Exception: Error building Player because scripts had compiler errors UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:341) UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:949) UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:923) UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:697) System.Reflection.MonoMethod.Invoke […]

Содержание

  1. Error building player because scripts had compiler errors
  2. unity error building player because scripts had compiler errors
  3. 3 Ответов

Error building player because scripts had compiler errors

Every time i try to build my game. I get an error:

Exception: Error building Player because scripts had compiler errors UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:341) UnityEditor.BuildPlayerWindow.GUIBuildButtons (Boolean enableBuildButton, Boolean enableBuildAndRunButton, Boolean canInstallInBuildFolder) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:949) UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:923) UnityEditor.BuildPlayerWindow.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/BuildPlayerWindow.cs:697) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:213) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:206) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/GUI/DockArea.cs:107)

I get t$$anonymous$$s error on both Web player and PC And Mac Standalone.

Источник

unity error building player because scripts had compiler errors

hello i been using unity pro for sometime now but i have never came across a error like t$$anonymous$$s. because of t$$anonymous$$s error i’m unable to build my game and finish it 🙁 please help from Ben

3 Ответов

Ответ от CHPedersen · 24/03/15 09:25

What t$$anonymous$$s is telling you is that you can’t use editor code in your builds. W$$anonymous$$ch, when you t$$anonymous$$nk about it, makes perfect sense. «UnityEditor» is the namespace for all the code that is executed in the Editor. It isn’t part of the engine («UnityEngine»).

Remove code from your game that uses components that are only available in the Editor. T$$anonymous$$s could be file dialogs, for example.

Ответ от jayant_vishwakarma · 18/10/16 06:41

it Seems that you are using package from asset store or any other place it happens because external packages contains demo scene you just need to delete all the script that are using UnityEditor just click on error message and unity will redirect you to the script look at the top of the script if there is statement like «using UnityEditor» delete that script and error will gone if it is not gone look there is another any script that contains «using UnityEditor» delete that.

Источник

Error building player because scripts при билде

Короче, стандартная проблема — при постройке билда консоль выдает ошибку Error building player because scripts had compiler errors. Лог ничего дельного не говорит (либо просто я слишком тупой и не понимаю, в каком скрипте ошибка). Ясно, что имеется в наличии проблемный скрипт/скрипты, а вот как их найти либо выявить, конечно же, неясно. Что я могу сделать?

Последний раз редактировалось JustOstrava 20 ноя 2017, 12:02, всего редактировалось 1 раз.

Не умеешь — так учись, в чем проблема-то? Вот не понимаешь — другое дело.

Аватара пользователя
JustOstrava
UNец
 
Сообщения: 25
Зарегистрирован: 29 янв 2016, 18:07
Откуда: Санкт-Петербург

Re: Error building player because scripts при билде

Сообщение Valentinus 19 ноя 2017, 21:42

JustOstrava писал(а): Что я могу сделать?

вариантов два:
1. сжечь второй том
2. показать всем лог

другое мое творчество: samlib.ru/u/us_w/

Аватара пользователя
Valentinus
Старожил
 
Сообщения: 889
Зарегистрирован: 24 мар 2017, 18:33

Re: Error building player because scripts при билде

Сообщение JustOstrava 20 ноя 2017, 12:02

Valentinus писал(а):

JustOstrava писал(а): Что я могу сделать?

вариантов два:
1. сжечь второй том
2. показать всем лог

Логи — это одно из тех вещей, в которых я не шарю (знаю, что с таким мозжечком далеко не уйду), да и к тому же больше 40к знаков здесь вперить нельзя. Поэтому получите запись лога после последней удачной компиляции библиотеки во время билда (если что-то не то сварганил, буду естессна исправлять)

Не умеешь — так учись, в чем проблема-то? Вот не понимаешь — другое дело.

Аватара пользователя
JustOstrava
UNец
 
Сообщения: 25
Зарегистрирован: 29 янв 2016, 18:07
Откуда: Санкт-Петербург

Re: Error building player because scripts при билде

Сообщение JustOstrava 21 ноя 2017, 09:56

Все, ошибка решена. Оказалось, что раз в где-то пять неудач консоль начинала ругаться красным значком на один скрипт, который я снес, и билд сразу пошел. Спасибо всем, кто хотя бы подумал, как можно помочь. (3A4OT)

Не умеешь — так учись, в чем проблема-то? Вот не понимаешь — другое дело.

Аватара пользователя
JustOstrava
UNец
 
Сообщения: 25
Зарегистрирован: 29 янв 2016, 18:07
Откуда: Санкт-Петербург


Вернуться в Общие вопросы

Кто сейчас на конференции

Сейчас этот форум просматривают: Google [Bot] и гости: 10



If the blog post cannot be displayed normally, please visit the original article:Unity to play Android package Android all error solutions (almost include all packaging errors)

Unity packaging error solution


This article provides the whole process, Chinese translation. Chinar Insist on bringing a simple lifestyle to the world!

(Have a better reading experience-high-resolution users please adjust the web page zoom ratio according to their needs)


Chinar —— Heart sharing, heart innovation!

Help quickly resolve

Unity Common mistakes in packaging

Save precious time for novices and avoid mining pits!

  • 1
    • Change Name —— Modified package name/company name/project name is not set
  • 2
    • SDK Tools —— The Unity version is low, and the Android tool version needs to be lower
  • 3
    • AR Vuforia Android TV —— Vuforia AR is in development, package Android error report
  • 4
    • Quote UnityEditor-script quotes UnityEditor and cannot be packaged
  • 5
    • Socket: bind failed, error: —— Socket binding failed
  • 5
    • Update —— Constantly updating……. Finally, all error reporting guides are collected
  • stand by
    • May Be-Engage in development, something to do one day!

1

Change Name —— Modified package name/company name/project name is not set

Modify package name / company name / project name because it is not set

Cause an error, the simplest

Specific error characters:
UnityException: Package Name has not been set up correctly
Please set the Package Name in the Player Settings. The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain alphanumeric characters and underscore.
Each segment must not start with a numeric character or underscore.
Error building Player: 2 errors
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
solution:

Change company name / package name / project name
举个栗子黑白88
——


2

Generally high version 2017.2-2017.3 will not report this error

Specific error characters:
Error:Invalid command android<br>UnityEditor.HostView:OnGUI()
CommandInvokationFailure: Unable to list target platforms. 
Please make sure the android sdk path is correct. See the Console for more details. 
Error building Player: CommandInvokationFailure: 
Unable to list target platforms. 
Please make sure the android sdk path is correct. See the Console for more details. 
solution:

Change the Android toolkit to a lower version

1. Click to download-Android Toolkit 24 version

2. After decompression, replace in Android SDK Tools folder

3. Then repack it and it will succeed! ! !

On the contrary: if Unity High version, also need to change to high version Android SDK Tools
举个栗子黑白88


3

AR Vuforia Android TV —— Vuforia AR is in development, packaged Android reports an error

due to Vuforia not support Android TV , Resulting in an error

Specific error characters:
Vuforia does not support Android TV. Please disable the Android TV compatibility in the Player Settings.

UnityEngine.Debug:LogError(Object)
BuildObserver:OnPreprocessBuild(BuildTarget, String)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Error building Player: Vuforia does not support Android TV. Please disable the Android TV compatibility in the Player Settings.
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:181 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:88 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

这里写图片描述

solution:

So need to Player Setting Turn off this option in

You can successfully package the project
举个栗子黑白88
这里写图片描述


4

Quote UnityEditor —— The script references UnityEditor and cannot be packaged

Error when packing project/engineering

Unity Asset In the directory, if the script is referenced UnityEditor

Then the script should be placed Editor Folder (if not, create a new one named Editor Folder)

Specific error characters:
Assets/CreateGuanJians.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed'
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:181 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:buildslaveunitybuildEditorMonoBuildPlayerWindowBuildMethods.cs:88 
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

这里写图片描述

solution:

Will quote with UnityEditor Put the script in Editor Under folder

(If not, create a new one named Editor Folder)

You can successfully package the project
举个栗子黑白88
这里写图片描述


5

Socket: bind failed, error: —— Socket binding failed

Open/new Unity Error during project

This is caused by insufficient permissions or occupied network ports

Specific error characters:
Socket: bind failed, error: An attempt was made to access the socket in a way that is not allowed by the access permissions.
(0)
Unable to join player connection multicast group.

切

solution:

1. direct Clear Empty the console and ignore it

2. Open with administrator rights Unity (Optional)


5

Update —— Continuously updating……. Finally, all error reporting guidelines are collected

Errors are constantly being updated……. Finally, all error reporting guidelines are collected

Please save and support Chinar


stand by

May Be —— Engage in development, something to do someday!

Own your own server, no need to find a guide! Chinar Provide one-stop tutorial, create with closed eyes!

Save precious time for novices and avoid mining pits!








Technical exchange group: 806091680! Chinar Welcome you to join


END

This blog is a non-profit personal original. Except for some works with a clear signature, the copyright of all works published is owned by me, and I reserve all legal rights. Offenders must be investigated

For those who need to copy, reprint, link and disseminate blog articles or content, please contact the blogger in time, leave a message, Email: [email protected]

For articles and content that are expressly authorized and permitted by this blogger, please indicate the source of the article or content and indicate the URL when using it

Понравилась статья? Поделить с друзьями:
  • Unity crash handler 32 как исправить
  • Unity bug reporter как исправить
  • Unity assets explorer stream read error
  • Unity assets explorer error wrong size dds
  • Unity asset store error