iOS Build Environment Help Center

Build stopping unexpectedly

append delete Aerilys

Hey folks!

I'm having troubles building my projects on my new Windows computer.
No matter which project I'm trying to build, it stops almost immediately when trying to compile the GameAssembly project (see the logs below).

The exact same project does compile on another Windows machine, so I know it's not a problem with the build. Knowing it could be a path issue, I did move the build folder in the iOS folder, at the root of the hard drive, but it didn't change anything, so I'm not sure it's the problem.

I tried with both the 3.62 and 3.64 versions, with two different iOS SDKs, with no difference.
Any help would be appreciated!

Build logs: https://pmbaty.com/paste/?2fc8d6317cbf3113#6CazjAxY5cbFFpvfAbgbXppHMHyVaXjit8HMnSqk1yfJ
Build version: 3.64
iOS SDK: 17.2
OS: Windows 11 Home

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

The GameAssembly library is the one that's built with Unity's own il2cpp compiler driver. The code path followed by the build script here is different. It begins under the block labeled "Unity-specific IL2CPP step" in the build.cmd file.

The symptoms you have typically happen in a batch script when a line passed to the command interpreter has an incorrect command syntax. This may be caused by undocumented subtleties in the Microsoft command-line tools (for example I've seen one case where the codepage in use completely changes the way the "find" command works). To narrow down the line where it fails, if you know how to edit a batch script without breaking the logic blocks, my advice is to drop lines such as "echo step N" every 5-10 lines in the build.cmd, with N incrementing, and run the build again. The build log should display "step 1", "step 2", etc. until the point where it fails ; from that point add more "echo" lines until you narrow down the precise line. Please post your findings and I'll tell you what to do next.

append delete #2. Aerilys

Thank you, I didn't know the main build was going through a bash script!
The issue was this line:

%
call "!SCRIPT_DIRECTORY!\!SCRIPT_NAME!" -xcname "!XCNAME!" -xcpname "!DEPENDENCY_PROJECTNAME!" -xcconf "!CONFIGURATION!" !EXTRA_FLAGS! -archs "!ARCHS!" -nodeps
%

When executing this line manually in a terminal, it gave me this error:

ERROR: the provisioning profile /usr/local/iosbuildenv/Keychain/my_provisioning_profile.mobileprovision specified in the default signing identity has not been found.

So it looked like an issue with the default identity. Fine, I fixed that. But then, the same specific command line failed! And it appears to be this part of the script (around l1300):

%
if "_!CORES!_"=="__" (
	rem // NOTE: "wmic" is available on all Windows machines since Windows XP (at least from SP3)
	wmic cpu get NumberOfLogicalProcessors 2>nul | findstr /v "NumberOfLogicalProcessors" > %TO_TEMPVAR%
	rem // remove spaces from value and default to 1 core if we couldn't get the actual number of cores
	if not "_!TEMPVAR!_"=="__" set CORES=!TEMPVAR: =!
	if "_!CORES!_"=="__" set CORES=1
)
%

Commenting this whole block allows me to build.
When trying to call the command "wmic" on a terminal, it is not recognized. Could that be the issue?
Let me know if you need more info!

append delete #3. Pierre-Marie Baty

You certainly nailed it. This is very interesting. On my Windows 11 VM the "wmic" command is recognized, but that's a Win11 Pro.

Looking it up on the web it looks like Microsoft is deprecating this utility: https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242 and tells us to use PowerShell instead.

<rant> Microsoft wants to force everybody into using PowerShell. But that is a totally non-portable, non-POSIX, "our way or the highway" scripting language, and the only case it makes sense to invest into learning this thing is when you're certain to spend your life among Windows machines. They're luring their users into a captive position and this is bad. </rant>

A replacement line could be:

%
powershell -c "Get-WmiObject -class Win32_processor|Select -ExpandProperty NumberOfLogicalProcessors" > %TO_TEMPVAR%
%

Let me know if it does the job.

append delete #4. Aerilys

Works like a charm, thank you so much!

And yes, I agree, MS has been trying (and failing) to force Powershell for so many years it's ridiculous.

Anyway, thanks again for your help, I'm happy to be able to keep using this to build!

append delete #5. Pierre-Marie Baty

There's another place a few lines below where a "wmic" call has to be replaced in the build script. It's only used if you use the "automatic version number scheme" feature. The next update of the builder (that I hope to release before the end of the year) will fix that.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty