Yet another IL2CPP build error

Building for Mono works, switching to IL2CPP and I get this:

Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly
at il2cpp.Conversion.ContextDataFactory.CreateConversionDataFromOptions(Il2CppCommandLineArguments il2CppCommandLineArguments)
at il2cpp.Conversion.ConversionDriver.Run(Il2CppCommandLineArguments il2CppCommandLineArguments)
at il2cpp.Program.DoRun(String[ ] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)```

Does anyone know what's going on?

This is rather odd. It looks like the Unity Editor is telling IL2CPP to convert some assemblies to C++ code, but there are no assemblies provided on the command line.

This is not something I’ve seen before, did this project build with IL2CPP on a previous Unity verison?

Thank you for your answer. I’ve been able to solve this problem by… (drumroll) Installing IL2CPP. For some weird reason, it was not installed but still was offered as an option in the Player Settings.

Oh, that is very interesting! Are you using the default Unity build process, or is there a custom player build happening in this project?

Wait no, I spoke to soon!

Ok, so this happened. Earlier this afternoon I went into the Unity Hub, went to “Installs” and saw IL2CPP was not installed. So I installed IL2CPP, loaded my project again and low and behold, I was able to build my project using IL2CPP. All during the day I encountered no problems and was able to build with IL2CPP.

Then my PC crashed during a build. :frowning:

I rebooted my PC and when I loaded my Project, it was corrupted. I got tons of error message it could not load GameObjects, or that it found Game Objects without reference, etc. etc. The loaded scene was completely f****** up.

So I restored the project from yesterday’s backup (only the project folder, nothing else). Loaded up the project and everything was fine. But when I tried to build for IL2CPP, I got the same error message as above again. IL2CPP is still installed (according to Unity Hub).

So still no idea what’s actually going on.

Default Unity build process.

This is so terribly frustrating. I finally had IL2CPP working, now I’m back to square one again…

So to reiterate:

  • I was unable to build my project using IL2CPP because of above mentioned error
  • I check the installed modules and saw that “Linux Build Support (IL2CPP)” was not installed - even though the IL2CPP linker was available (otherwise I could not get the aforementioned linker error)
  • I install “Linux Build Support (IL2CPP)” and building my project using IL2CPP worked (hurray!)
  • My system crashes in the middle of a build. When I restart my PC and load my project, it’s corrupt (beyond repair).
  • I restore from last night’s backup but now building my project using IL2CPP gives me the same error as before, even though it (IL2CPP) is now marked as “Installed”

So yeah. I’m at a loss for now…

Are you on a Windows computer cross-compiling for IL2CPP on Linux in this case?

Yes I am. I think I found the culprit.Under “Player Settings” → “Other Settings” → “Graphic APIs”, I had both Vulcan and OpenGLES3 listed.After removing Vulcan, I was able to build without errors.

This seems like a really bad error message for that case. Somethings should warn you about that earlier. I’m glad you made it work though.

Sorry, I left something out. “Auto Graphics API” was actually enabled. I had to disable it after which I also disabled “Vulcan”.

This is driving me insane… The error is back. I made a change in the “Managed Stripping Level” setting. Changed it from “Low” to “Minimal”. That gave me an error (which apparently was a known problem with a plug-in I’m using) so I change it back to “Low” again and now I’m getting the original error again.

So apparently, the error is not related to one specific thing but just pops up whenever it feels like it. :frowning:

Have you managed to fix this in the end?

same problem,2022.2.2,i am Mac m1 user

For me, it definitely had something to do with the Graphics API settting (in the Player settings). I enabled “Auto Graphics API”, immediately disabled it (and I think I also removed “Vulkan” at that time) and the error went away and never came back…

could not find that option on 2022.2.2 :frowning:

i downgrade project from 2022.2.2 to 2021.1.23 my problem resolved!

I took build for iOS!!!

1 Like

Same problem here.
We had to pass to 2022 for the navmesh features, but unable to build on iOS since then…

/Applications/Unity/Hub/Editor/2022.2.3f1/Unity.app/Contents/il2cpp/build/deploy/il2cpp --convert-to-cpp --generatedcppdir=/Users/briced/_PROJETS/RailShooter/Library/Bee/artifacts/iOS/il2cppOutput/cpp --enable-analytics --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-macos --profiler-report --profiler-output-file=/Users/briced/_PROJETS/RailShooter/Library/Bee/artifacts/il2cpp_conv_8vp6.traceevents --print-command-line --external-lib-il2-cpp=/Libraries/libil2cpp.a --data-folder=/Users/briced/_PROJETS/RailShooter/Library/Bee/artifacts/iOS/il2cppOutput/data
Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly
   at il2cpp.Conversion.ContextDataFactory.CreateConversionDataFromOptions(Il2CppCommandLineArguments il2CppCommandLineArguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Conversion/ContextDataFactory.cs:line 22
   at il2cpp.Conversion.ConversionDriver.Run(TinyProfiler2 tinyProfiler, Il2CppCommandLineArguments il2CppCommandLineArguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Conversion/ConversionDriver.cs:line 18
   at il2cpp.Program.DoRun(TinyProfiler2 tinyProfiler, String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Program.cs:line 243

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

Deleting the Library folder in my project and reopening my unity project and building again fixed this issue for me. I was seeing the error

Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly

But after doing this it went away

Deleting Library folder also fixed the issue for me