The il2cpp.exe process starts using a lot of CPU, like over 80%, and then it starts to go lower until it reaches 0% and never goes up. When the process doesn’t get stuck, it spawns a bunch of “clang++.exe” processes, and that’s when I know it worked. But it just fails too often. How do I fix this? How do I even kill the il2cpp process? I can’t kill it no matter what I do.
When it is stuck, can you use Task Manager to generate a dump file for the il2cpp.exe process? That will include all of the threads running in the process and hopefully allow us to analyze it.
@JoshPeterson Okay. Do you know a way to kill the process without needing to restart the computer? Or how to delete the Library/il2cpp_android_arm64-v8a and Library/Il2cppBuildCache folders without restarting the computer. Every time I interrupt the build when the process gets stuck, I need to restart the computer to be able to delete those folders and build again. If I don’t delete those folders I get an error, and if I try to delete them without restarting the computer I get a message saying that I can’t because something else is using the folders, but I don’t know what.
I am trying to create the dump file, but apparently it’s stuck lol. Does it take a while?
Yup I can’t create a dump. When it succeeds, I get a message like this immediately:
il2cpp stays like this forever:
I’m not sure why the dump file cannot be created. Maybe wait longer though - I don’t now how long it should take.
To be able to delete those files, you will likely need to kill all clang++.exe processes on the machine. You can do that via the command line like this:
taskkill /F /IM clang++.exe /T
Can you take a look at how much memory il2cpp.exe uses when it hangs?
Almost 2GB.
The clang++ processes are not spawned when il2cpp hangs. However I will give it a go.
I’m trying to get a dump with process explorer.
Ah windows is so beautiful, process explorer hanged trying to create a dump for il2cpp.
This time it will build, the clang++ processes were spawned. They use up 99% of the CPU. I know it fails if after 2 minutes no clang++ process was spawned and il2cpp.exe is using 0% of the CPU.
@JoshPeterson the dump file has almost 2GB, I can’t upload!
Can you upload it to Google Drive (or something similar) and share the link with me via a private message?
Is this a regression that started only on 2020.3? 2020.1 never did this?
Does the issue occur already when building an empty project?
Yes it happens on an empty project as well. The default URP template with WebGL target can fail. I can’t find a pattern though. After building multiple times it starts to hang, and it becomes increasingly difficult to successfully build.
@jukka_j Never, ever. 2020.1 is safe to me. But 2020.3 onwards it can hang. Happened on multiple projects, with WebGL and Android targets. 2021 same thing. At this point I gave up and I’m stuck with 2020.1.
If you can tell me a way to kill the il2cpp process and be able to rebuild without having to restart the computer, that already helps.
Here’s another related thread: Can't build webgl project ever again after you cancel it