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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Bug Fails to compile on android arm 32

Discussion in '2021.2 Beta' started by creat327, Jul 3, 2021.

  1. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    Anyone got it to compile any project on Android using Arm 32 bits?
    My projects compile just fine for Arm 64 but they stopped compiling anything for 32 bits, which is still a huge user base.

    When I try to compile it always gets stuck for about 20 minutes in Link_Android_arm32 Library/Bee/artifacts/Android/fy9m/libil2cpp.so

    Then it times out with error:
    Building Library\Bee\artifacts\Android\fy9m\libil2cpp.so failed with output:
    C:/Java/android-ndk-r21d/toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld.gold.exe: internal error in arm_branch_common, at /buildbot/src/android/binutils/toolchain/binutils/binutils-2.27/gold/arm.cc:4063
    clang++: error: linker command failed with exit code 1 (use -v to see invocation)
    UnityEditor.GenericMenu:CatchMenu (object,string[],int)
     
  2. Llotar

    Llotar

    Joined:
    Mar 27, 2016
    Posts:
    14
    We got the same error as you, when building on local machine.
    But when building on server, error had extra description - "Out of memory" .
    Increasing RAM from 14GB to 32 GB - solved the issue. But from observation, it seems like 17-18 Gb should be enough (still might depend on project size).
    Nevertheless that looks like bug
     
  3. Llotar

    Llotar

    Joined:
    Mar 27, 2016
    Posts:
    14
    Unfortunately now error is back, and even rebuilding previously successful changeset now fails
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,064
    Hi,

    This doesn't seem to be a known issue. Could you please submit a bug report if you are affected by this behaviour, ideally with a reproducible attached?
     
  5. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    Yes, I can confirm this bug is back. In beta 9 you can't compile my project for arm32 again.

    Can anyone submit a bug report? I can't. My project is so large that it fails to upload every single time. Tried for 3 days already. And I tried to trim it but I must touch something that stops the bug from happenning. It only happens with the full project.
     
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,064
    If you can't upload the project via the bug reporter, you can ask QA for an alternative way to provide them with the project. They can give you access to a private Drive folder to upload the project into.
     
  7. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    Ok, I submitted it as 1363447 without any project since otherwise i can't even submit. And I added a request for QA to contact me with some other upload method. Btw, it's failing on b10 too.

    thanks
     
  8. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    nobody from QA contacts me...
     
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,064
    Please give it some time. They will get to it.
     
  10. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    nothing, still waiting. It's not like they need to check the project, i'm just waiting for them to tell me how to upload the project. Not sure why it's taking so long.
     
  11. ArthurTheKing

    ArthurTheKing

    Joined:
    Aug 4, 2015
    Posts:
    9
    Got the same problem on the project and also could not submit it (probably it is too large), but managed to create and submit a smaller reproducible project. Case 1364218
     
    creat327 likes this.
  12. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    I've submitted a project and basically got ignored. It's still not compiling on the oficial out of beta release. Stuck with 2021.1
     
  13. ArthurTheKing

    ArthurTheKing

    Joined:
    Aug 4, 2015
    Posts:
    9
    Unity closed the case as it is an issue with android NDK and they cannot resolve it (https://issuetracker.unity3d.com/issues/android-build-fails-when-using-armv7-target-architecture).
    As a workaround Unity devs suggested:
    1. See if you can make the code used in this Unity project smaller. One option here is to use the new option discussed here: https://forum.unity.com/threads/il2cpp-build-time-improvements-seeking-feedback.1064135
    2. It looks like this only happens when the C++ Compiler Configuration is set to "Master". You can instead use the "Release" configuration option.
    We ended up usibg the 2nd option in our project
     
    awyld, ArthurAulicino, -chris and 2 others like this.
  14. VladPrichina

    VladPrichina

    Joined:
    Mar 19, 2020
    Posts:
    4
    We are also getting this same issue after upgrading from version 2021.1.27f1 to 2021.2.7f1.
    Out of memory on machine with 16GB RAM or stuck in Link_Android_arm32 on machine with 32GB RAM.
    These workarounds are not suitable for us.

    Is it possible that issue will be fixed in nearest releases (Android NDK will be updated)?
    Or maybe there are other workarounds?
     
    pivot_RyomaShibata likes this.
  15. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    It's fixed on the updated Android NDK. All Unity has to do is use the newer NDK instead of an old one. Until then, we are stuck in 2021.1.27 too.
     
    pivot_RyomaShibata likes this.
  16. pivot_RyomaShibata

    pivot_RyomaShibata

    Joined:
    Oct 13, 2020
    Posts:
    8
    same issue here.
    Unity should change the NDK version to something more up-to-date.
     
    -chris likes this.
  17. eli_funzy

    eli_funzy

    Joined:
    Jan 15, 2021
    Posts:
    3
    This drives me crazy. Impossible to compile IL2CPP for ARM64 on master mode.
     
  18. eli_funzy

    eli_funzy

    Joined:
    Jan 15, 2021
    Posts:
    3
    Tried to use only the NDK from Unity 2022, and build with Unity 2021. didn't work.
     
    pivot_RyomaShibata likes this.
  19. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    those use the same NDK. They only upgraded the NDK on 2022.2 alpha versions. Until then, you are stuck with 2021.1.27 or not building on master mode. I don't understand why they decided to change the NDK in the middle of the 2021.1 versions and then don't upgrade it to fix what they broke.
     
  20. HyagoOliveira

    HyagoOliveira

    Joined:
    May 17, 2021
    Posts:
    6
    I could compile my project setting C++ Compiler Configuration to Debug

    upload_2022-6-7_11-40-11.png
     
    lanpartygamesstudio likes this.
  21. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    If you don't set it to master it works. We know that. If you release using "debug", I feel sorry for your customers lol
     
    -chris and eli_funzy like this.
  22. pansiketsu

    pansiketsu

    Joined:
    May 10, 2017
    Posts:
    2
    This is a bug in this ticket, can you tell me how many NDK versions have fixed it?
     
  23. Ceylan12

    Ceylan12

    Joined:
    Dec 24, 2016
    Posts:
    113
    I'm having the same problem with Unity 2021.3.6 with master c++ compiler configuration. It works fine with a release and debug. Which version of NDK helped with this issue?
     
  24. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    99
    The trick is to still use "Release", far as I'm aware...

    Or try a more recent version of Unity:
     
    Ceylan12 likes this.
  25. pradotech

    pradotech

    Joined:
    Oct 17, 2019
    Posts:
    35
    2021.3.8f1 was released and this issue still happens. I wonder when will Unity solve this.
     
  26. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,700
    they are not solving it in the 2021 branches. I don't understand why they don't, but they don't. You need to move to 2022
     
  27. pradotech

    pradotech

    Joined:
    Oct 17, 2019
    Posts:
    35
  28. Chibi_Phoenix

    Chibi_Phoenix

    Joined:
    Nov 12, 2019
    Posts:
    4
    Wow thank you for this post, I was encountering the EXACT same problem and it was driving me crazy. Used your posted solution and it works again!
    I had to change stripping to Medium (was Minimum) and removed a bunch of deprecated scripts to get it to compile again.
     
    Last edited: Dec 17, 2022