Compilation failed because the compiler couldn't be executed

i cant run the game becuause of “Compilation failed because the compiler couldn’t be executed!” and three simaler errors. how can i fix this.

the other errors are:

ApplicationException: Unable to find a
suitable compiler
UnityEditor.Scripting.ScriptCompilers.CreateCompilerInstance
(MonoIsland island) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/Scripting/ScriptCompilers.cs:87)

Failed to create compiler instance

KeyNotFoundException: The given key
was not present in the dictionary.
System.Collections.Generic.Dictionary2[System.String, UnityEditor.VisualStudioIntegration.ScriptingLanguage].get_Item (System.String key) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.ProjectFile (MonoIsland island, Boolean forVisualStudio) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:253) UnityEditor.VisualStudioIntegration.SolutionSynchronizer+<GetProjectEntries>c__AnonStorey10.<>m__1D (MonoIsland i) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:311) System.Linq.Enumerable+<CreateSelectIterator>c__Iterator102[UnityEditor.Scripting.MonoIsland, System.String].MoveNext
()
System.Collections.Generic.List1[System.String].AddEnumerable (IEnumerable1 enumerable)
System.Collections.Generic.List1[System.String]..ctor (IEnumerable1 collection)
System.Linq.Enumerable.ToArray[String]
(IEnumerable1 source) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.GetProjectEntries (IEnumerable1 islands, Boolean
forVisualStudio) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:316)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SolutionText
(IEnumerable1 islands, Boolean onlyCSharp) (at C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:300) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncSolution (IEnumerable1 islands) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:291)
UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync
() (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:131)
UnityEditor.SyncVS.SyncVisualStudioProjectIfItAlreadyExists
() (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/SyncProject.cs:89)

Failed to create compiler instance
UnityEditor.HostView:OnGUI()

Exception: Error building Player
because scripts had compiler errors
UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings
(Boolean askForBuildLocation,
BuildOptions forceOptions) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367)
UnityEditor.BuildPlayerWindow.GUIBuildButtons
(Boolean enableBuildButton, Boolean
enableBuildAndRunButton, Boolean
canInstallInBuildFolder) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:979)
UnityEditor.BuildPlayerWindow.ShowBuildTargetSettings
() (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:953)
UnityEditor.BuildPlayerWindow.OnGUI ()
(at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:726)
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/842f9557127e852/Editor/Mono/GUI/DockArea.cs:225)
UnityEditor.HostView.Invoke
(System.String methodName) (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:218)
UnityEditor.HostView.OnGUI () (at
C:/BuildAgent/work/842f9557127e852/Editor/Mono/GUI/DockArea.cs:119)

If you have a folder in your projects with your builds. Remove that! I had the same problem, removed the builds folder and it worked.

This worked for me, simply go into the directory your project is in and delete the “Library” folder and reopen your project.

Unity will rebuild the library folder automatically (it will take some time) and it will work again.

My guess is it’s due to a corruption to some files in the library.

You can create a new project in another directory and with another name. Then manually copy and past your assets folder from last bug shit project to the new one.You can see the errors will disappear!

Same is going on with me :frowning: i realy need help

Hi guys,

This is probably too late- but I’ve experienced this issue several times myself and thought I’d provide a possible solution for anyone who comes lurking here in the future. I tried reinstallation, even reverted to previous backups to resolve the problem, but none seemed to work.

I’m not 100% sure what causes it, but I can confirm that it has occurred several times when I have imported scripts from outside sources and tried to apply them to gameobjects without first compiling them in my compiler (I use monodevelop).

I can confirm that reimporting all assets will resolve the issue. Unfortuantely, it can take a few hours to complete, but it does resolve the issue and get you a workable project back.

Hope this helps,

Luke

Try different android device.

Okay guys, i dont know if the previous stuff for you have worked but i tried other things that are posted here and found a combination works the best. So what works for me, is you delete the library folder completely, open unity, then right click in your assets folder and click “reimport all assets”. this may take a little bit. after that you should be fine.

Hope this helped! :smiley:

thank you so much this solution solved my problem.
" simply go into the directory your project is in and delete the “Library” folder and reopen your project."