Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2020.3.X, 2021.1.X



Found in





Issue ID




[Windows] Build fails due to read-only files detected as native plugins by Unity



How to reproduce:
1. Open the user's attached project
2. Make the myfile.h file in the project read-only (in the user's case, Perforce will do this, but we can emulate it here).
3. In the Build settings, set Windows Standalone as Target Platform and build the project (build should succeed)
4. Confirm that you see a copy of the "myhfile.h" file in the IL2CPP output folder (\build_error_repro\Library\Il2cppBuildCache\Windows\x64\il2cppOutput) and that this file is read-only
5. In Unity Editor, add a new script to the project
6. Build the project again

Expected results: Build succeeds
Actual results: Build fails, an error can be seen in the console: "Failed running C:\Program Files\2020.2\2020.2.3f1_270dd8c3da1c\Editor\Data\il2cpp/build/BeeSettings/offline/bee.exe --useprebuiltbuildprogram --no-colors"

Reproducible with: 2020.2.0a17, 2020.2.3f1, 2021.1.0b5, 2021.2.0a4
Not reproducible with: 2018.4.31f1, 2019.4.20f1, 2020.2.0a16 ("myhfile.h" file is not present in the Library folder, so the build succeeds)

1. Deleting the Library folder allows the build to succeed again
2. With Unity 2020.2.0a17 the same error appears after a first build
3. This issue is related to Unity detecting any .h file in the Assets folder as a Native Plugin. See

  1. Resolution Note (fix version 2021.2):

    Fixed in: 2021.2.0a7

  2. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.1f1

  3. Resolution Note (fix version 2020.3):

    Fixed in 2020.3.3f1

Comments (3)

  1. ahmedaniss

    May 23, 2021 18:23

  2. ColeenT

    Apr 21, 2021 23:15

    Issue present in 2020.3.4f1

  3. cla08

    Mar 13, 2021 14:43

    Issue is present in 2020.3.0f1 as well, after upgrading to 2020.1.17

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.