Search Issue Tracker

Fixed

Votes

2

Found in

2019.2

2019.3.0b3

2020.1

Issue ID

1183728

Regression

No

[Linux] [Android] IL2CPP build fails with Access denied error, insufficient permissions in NDK directory

Linux

-

How to reproduce:
1. Create or open any project with a Unity version that was downloaded through the Hub (along with the Android SDK & NDK Tools)
2. Go to Project Settings -> Player -> Other Settings
3. Ensure that in Configuration, Scripting Backend is set to IL2CPP
4. Build for Android

Expected results: Build succeeds
Actual results: Build fails with Access denied error

Reproducible with: 2019.2.6f1, 2020.1.0a3 (downloaded through Hub)
Could not test with 2017.4, 2018.4 because Hub does not include Android SDK & NDK Tools with the install on those versions
Could not test with 2019.3 because I could not find OpenJDK anywhere in PlaybackEngines/AndroidPlayer

Some of the error:
stdout:
Building libil2cpp.so with AndroidToolChain
Output directory: /media/pauliusg/Storage/Projects/testing_ndk/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a
Cache directory: /media/pauliusg/Storage/Projects/testing_ndk/Library/il2cpp_android_armeabi-v7a/il2cpp_cache
il2cpp.exe didn't catch exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: ApplicationName='/media/pauliusg/Storage/Unities/from_hub/2020.1.0a3/Editor/Data/PlaybackEngines/AndroidPlayer/NDK/android-ndk-r19/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++',
...
"/media/pauliusg/Storage/Projects/testing_ndk/Library/il2cpp_android_armeabi-v7a/il2cpp_cache/8C89B7543F6503EFC1034E74F96CE414.o"', CurrentDirectory='', Native error= Access denied

Notes:
- In Editor/Data/PlaybackEngines/AndroidPlayer/NDK/<ndk_version>/toolchains/llvm/prebuilt/linux-x86_64/bin, a lot of files do not have 'execute' permissions, most importantly - clang, which IL2CPP compiler is trying to run

  1. Resolution Note:

    Fixed with Unity Hub version 2.3.0

Comments (4)

  1. afshin_a_1

    Jul 17, 2023 08:18

    last but not least unity should care more about linux, because many developers prefer to use Linux instead of Windows.. nowdays even amateur users are using linux thanks to ubuntu and it's community is going bigger and bigger.

  2. alexeymatal

    Feb 09, 2020 16:12

    Hello I had the ssame issue and I solved it when set execute-rights to the all NDK-binaries manually. (it was 644 after downloaded via hub)

  3. alexeymatal

    Feb 09, 2020 16:10

    Hello I had the same issue. I solved it when manually set execute-rights to the all NDK-binaries. (it was 644 after downloaded via hub)

  4. fercampana09

    Oct 17, 2019 16:16

    I had the same issue. Solved it by replacing NDK with this one: https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip

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.