Search Issue Tracker

Third Party Issue

Votes

21

Found in

2021.2

2021.2.17f1

2021.3

2022.1

2022.2

Issue ID

1413756

Regression

Yes

[IL2CPP] Android Build failure when building project with ToolBuddy asset and IL2CPP Scripting Backend selected

IL2CPP

-

Reproduction steps:
1. Open the attached user's project
2. Go to File > Build Settings and switch to Android Platform
3. In the Build Settings window press the Player Settings button
4. In Player Settings make sure that Scripting Backend is set to IL2CPP
5. Go back to Build Settings and Build the project
6. Observe errors that appear in the Console window

Expected result: The Build is successful
Actual result: The Build fails and errors are thrown in the Console window

Reproducible with: 2021.2.19f1, 2021.3.0f1, 2022.1.0b15, 2022.2.0a10
Not reproducible with: 2019.4.37f1, 2020.3.33f1, 2021.1.28f1

Notes:
- Issue is reproducible when building for Android
- Issue is not reproducible when building with Mono Scripting Backend selected
- Issue is not reproducible when building for iOS, Mac/Windows Standalone
- When navigating to Assets > Plugins and deleting the "ToolBuddy" folder, the Build is successful
- Errors in the Console window:
"Building Library/Bee/artifacts/Android/fy9m9/libil2cpp.so failed with output:
/Users/*user name*/Library/Android/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: internal error in arm_branch_common, at /Volumes/Android/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)"
"BuildFailedException: Incremental Player build failed!"

  1. Resolution Note (2022.2.X):

    It looks like this is a bug in the gold linker shipped with the Android r21 NDK that is used by Unity, when link time optimization is enabled. We can work around this issue in one of two ways:

    1. For Unity 2022.1 and earlier versions, change the C++ Compiler Configuration option from a value of "Master" to a value of "Release". This will avoid link time optimization, and therefore avoid the error. This may change the performance characteristics of the code at run time though.

    2. Use Unity 2022.2 and later, where Unity uses the r23 NDK and the lld linker. This bug is not present in that version.

Comments (1)

  1. ertbaran

    Sep 18, 2023 21:00

    Thanks. "Master" to "Release" work for me.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.