Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Yet another IL2CPP build error

Discussion in 'Android' started by PenProd, Jan 9, 2023.

  1. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    Building for Mono works, switching to IL2CPP and I get this:

    F:\Programming\Unity\Unity Editor\2021.3.16f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --data-folder=F:/Programming/Unity/Projects/MyGame/Library/Bee/artifacts/Android/il2cppOutput/data --generatedcppdir=F:/Programming/Unity/Projects/MyGame/Library/Bee/artifacts/Android/il2cppOutput/cpp --enable-analytics --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=F:/Programming/Unity/Projects/MyGame/Library/Bee/artifacts/il2cpp_conv_xqeu.traceevents --print-command-line
    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?
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,789
    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?
     
  3. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,789
    Oh, that is very interesting! Are you using the default Unity build process, or is there a custom player build happening in this project?
     
  5. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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. :(

    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.
     
  6. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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:
    1. I was unable to build my project using IL2CPP because of above mentioned error
    2. 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)
    3. I install "Linux Build Support (IL2CPP)" and building my project using IL2CPP worked (hurray!)
    4. My system crashes in the middle of a build. When I restart my PC and load my project, it's corrupt (beyond repair).
    5. 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...
     
    Last edited: Jan 9, 2023
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,789
    Are you on a Windows computer cross-compiling for IL2CPP on Linux in this case?
     
  8. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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.
     
  9. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,789
    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.
     
  10. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    Sorry, I left something out. "Auto Graphics API" was actually enabled. I had to disable it after which I also disabled "Vulcan".
     
  11. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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. :(
     
  12. Vaitaliy

    Vaitaliy

    Joined:
    Jan 10, 2019
    Posts:
    7
    Have you managed to fix this in the end?
     
  13. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    141
    same problem,2022.2.2,i am Mac m1 user

     
  14. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    150
    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...
     
  15. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    141
    could not find that option on 2022.2.2 :(
     
  16. hexdecc

    hexdecc

    Joined:
    Oct 24, 2014
    Posts:
    141
    i downgrade project from 2022.2.2 to 2021.1.23 my problem resolved!

    I took build for iOS!!!
     
    PenProd likes this.
  17. brice_allinc

    brice_allinc

    Joined:
    Feb 9, 2022
    Posts:
    3
    Same problem here.
    We had to pass to 2022 for the navmesh features, but unable to build on iOS since then...
     
  18. brice_allinc

    brice_allinc

    Joined:
    Feb 9, 2022
    Posts:
    3
    Code (CSharp):
    1. /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
    2. Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly
    3.    at il2cpp.Conversion.ContextDataFactory.CreateConversionDataFromOptions(Il2CppCommandLineArguments il2CppCommandLineArguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Conversion/ContextDataFactory.cs:line 22
    4.    at il2cpp.Conversion.ConversionDriver.Run(TinyProfiler2 tinyProfiler, Il2CppCommandLineArguments il2CppCommandLineArguments) in /Users/bokken/build/output/unity/il2cpp/il2cpp/Conversion/ConversionDriver.cs:line 18
    5.    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
    6.  
    7. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
    8.  
     
  19. EthanFischer

    EthanFischer

    Joined:
    Feb 10, 2016
    Posts:
    46
    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
     
  20. svermeulen

    svermeulen

    Joined:
    Aug 4, 2020
    Posts:
    1
    Deleting Library folder also fixed the issue for me
     
  21. VasilevVlad

    VasilevVlad

    Joined:
    Jul 13, 2015
    Posts:
    2
    Don't remove all Library folder.
    Just remove Il2cppBuildCache in that one. Your next build will be ok.
     
    nh92 likes this.