Build failed with this error:

I have tried googling but can’t find any solution. Does anyone know what’s wrong? Thanks a lot!
It’s a PC Windows build.

Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\link.exe /out:"E:\Dropbox\HK\repo\My Bizarre Childhood Stories\Library\il2cpp_cache\linkresult_2DCF6D0D9CDAB5DDAFCAC904837B7BDE\GameAssembly.dll" /ignore:4206 /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /NXCOMPAT /DYNAMICBASE /NOLOGO /TLBID:1 /OPT:REF /OPT:ICF /HIGHENTROPYVA /DLL /IGNORE:4104 /NODEFAULTLIB:uuid.lib "kernel32.lib" "user32.lib" "advapi32.lib" "ole32.lib" "oleaut32.lib" "Shell32.lib" "Crypt32.lib" "psapi.lib" "version.lib" "MsWSock.lib" "ws2_32.lib" "Iphlpapi.lib" "Dbghelp.lib" "C:\Program Files\Unity\Hub\Editor\2021.1.5f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\Variations\win64_nondevelopment_il2cpp\baselib.dll.lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64" /SUBSYSTEM:WINDOWS @"C:\Users\user\AppData\Local\Temp\tmp13F0.tmp"

Creating library E:\Dropbox\HK\repo\My Bizarre Childhood Stories\Library\il2cpp_cache\linkresult_2DCF6D0D9CDAB5DDAFCAC904837B7BDE\GameAssembly.lib and object E:\Dropbox\HK\repo\My Bizarre Childhood Stories\Library\il2cpp_cache\linkresult_2DCF6D0D9CDAB5DDAFCAC904837B7BDE\GameAssembly.exp
A8A5C1165ED226F7197704107FCADFC1.obj : error LNK2019: unresolved external symbol OpenNewTab referenced in function ExternalLink_OpenNewTab_mB008746A596512A17A036C4BD3BE7D4A6D8EFD45
E:\Dropbox\HK\repo\My Bizarre Childhood Stories\Library\il2cpp_cache\linkresult_2DCF6D0D9CDAB5DDAFCAC904837B7BDE\GameAssembly.dll : fatal error LNK1120: 1 unresolved externals

   at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
   at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo) (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data) (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <756e9f00f78640ec93f83e08257daaec>:0)
DesktopStandalonePostProcessor.RunIL2CPP (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, System.Collections.Generic.List`1[T] cppPlugins) (at <756e9f00f78640ec93f83e08257daaec>:0)
DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <756e9f00f78640ec93f83e08257daaec>:0)
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <756e9f00f78640ec93f83e08257daaec>:0)
Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <756e9f00f78640ec93f83e08257daaec>: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 <756e9f00f78640ec93f83e08257daaec>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

I don’t really have answer for you, but if this is really a Dropbox folder, first thing you should do is to move your project to a non-dropbox folder. It is a very bad idea having your Unity project in a Dropbox folder. You are risking your project.
It is fine manually copy your project as a backup into a Dropbox folder, but do not open it from there.

1 Like

Thx for telling. Although the folder is called dropbox, my dropbox is not running.

I still wouldn’t trust it, there is possibly even some long-term corruption in the project files from doing this. Dropbox and Unity do NOT mix well at all. Fortunately there are way better solutions:

I’m sorry you’ve had this issue. Please consider using proper industrial-grade source control in order to guard and protect your hard-earned work.

Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

As far as configuring Unity to play nice with git, keep this in mind:

https://discussions.unity.com/t/736093/3

Here’s how I use git in one of my games, Jetpack Kurt:

https://discussions.unity.com/t/807568/3

Using fine-grained source control as you work to refine your engineering:

https://discussions.unity.com/t/826718/2

Share/Sharing source code between projects:

https://discussions.unity.com/t/719810/2

Setting up an appropriate .gitignore file for Unity3D:

https://discussions.unity.com/t/834885/5

Generally setting Unity up (includes above .gitignore concepts):

https://thoughtbot.com/blog/how-to-git-with-unity

It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place.

“Use source control or you will be really sad sooner or later.” - StarManta on the Unity3D forum boards

1 Like

Thanks for all the info! I am currently using Source Tree for source control but I will look into your suggestions.

I just tried using mono instead of il2cpp for the build and it worked!

Solved.
It was caused by an external script I am using for WebGL version to open a link.
putting this around that code solved it:

#if  UNITY_WEBGL
#endif

it works with il2cpp now too!

1 Like