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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Building fail with il2cpp by generated CPP file's encoding.

Discussion in 'Android' started by FlowORemi, Dec 6, 2020.

  1. FlowORemi

    FlowORemi

    Joined:
    Apr 26, 2019
    Posts:
    7
    Details
    -unity version : 2018.3.8f1
    -NDK : r16b downloaded from google
    -Note that It's not my own project I've got this project from my friend.

    Code (CSharp):
    1. Failed running C:\Program Files\Unity\Hub\Editor\2018.3.8f1\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="net20" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="C:\UnityProject\puzzleboom\puzzleboom\Temp/StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\UnityProject\puzzleboom\puzzleboom\Assets\..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2018.3.8f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Hub\Editor\2018.3.8f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/UnityOlderNDK/android-ndk-r16b-windows-x86_64/android-ndk-r16b" --map-file-parser="C:\Program Files\Unity\Hub\Editor\2018.3.8f1\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --directory="C:\UnityProject\puzzleboom\puzzleboom\Temp\StagingArea\assets\bin\Data\Managed" --generatedcppdir="C:\UnityProject\puzzleboom\puzzleboom\Temp\StagingArea\Il2Cpp\il2cppOutput"
    2.  
    3. stdout:
    4. Building libil2cpp.so with AndroidToolChain
    5.     Output directory: C:\UnityProject\puzzleboom\puzzleboom\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a
    6.     Cache directory: C:\UnityProject\puzzleboom\puzzleboom\Library\il2cpp_android_armeabi-v7a\il2cpp_cache
    7. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: fatal error: UTF-16 (LE) byte order mark detected in 'C:\UnityProject\puzzleboom\puzzleboom\Temp\StagingArea\Il2Cpp\il2cppOutput\stdafx.cpp', but encoding is not supported
    8. 1 error generated.
    9.  

    Because of those cpp files generating when build with il2cpp always getting encoding problems. How can I solve this problem please help...
     

    Attached Files:

  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,669
    Try using 2018 LTS version and see if it helps.

    Also, note, support for 2018 ends in the near future (2-3 months), at the very least you should switch to 2019 or higher
     
    FlowORemi likes this.
  3. FlowORemi

    FlowORemi

    Joined:
    Apr 26, 2019
    Posts:
    7
    Thanks for your reply but still generating those unsupported encoding of cpp files and build error in 2018 LTS version.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,773
    Note that stdafx.cpp is not generated by IL2CPP. I'm not sure where that file is coming from though. Is it somewhere in the Assets folder of the project? There is code in the build process that will try to copy .cpp files into the generated IL2CPP output directory so that they can be compiled along with the generated code. Maybe that is happening.
     
    FlowORemi likes this.
  5. FlowORemi

    FlowORemi

    Joined:
    Apr 26, 2019
    Posts:
    7
    Well I'm gonna kick my friend's ass that he put useless cpp and header in Assets/Sprites folder?? Thank you sir!! You saved my life.