"readlink('/proc/self/fd/67') failed: Permission denied [fd=67]" errors

I’m doing a Gradle build with Unity 2019.4.21f1, target Android 10.0, and testing on a Nexus with Android 6.0.

I get these error when I try to initialize the Google Mobile Ads SDK for AdMob (among other places), and the SDK doesn’t work (device logs below). On an Android 10 I tried this error is not there and the SDK works.

Any suggestions for how to go about fixing this?

** Logs When Initializing **

03-03 21:14:45.986 17696 17740 I Unity : Will initialize AdMob
03-03 21:14:45.986 17696 17740 I Unity : AdMobAdHelper:Setup(AdManager, Boolean)
03-03 21:14:45.986 17696 17740 I Unity : AdManager:Start()
03-03 21:14:45.986 17696 17740 I Unity :
03-03 21:14:45.986 17696 17740 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
03-03 21:14:45.986 17696 17740 I Unity :
03-03 21:14:46.033 17696 17740 E linker : readlink(‘/proc/self/fd/67’) failed: Permission denied [fd=67]
03-03 21:14:46.033 17696 17740 E linker : warning: unable to get realpath for the library “/system/framework/oat/arm64/com.android.location.provider.odex”. Will use given name.
03-03 21:14:46.035 17696 17740 E linker : readlink(‘/proc/self/fd/67’) failed: Permission denied [fd=67]
03-03 21:14:46.035 17696 17740 E linker : warning: unable to get realpath for the library “/system/framework/oat/arm64/com.android.media.remotedisplay.odex”. Will use given name.
03-03 21:14:46.039 17696 17740 E linker : readlink(‘/proc/self/fd/67’) failed: Permission denied [fd=67]
03-03 21:14:46.039 17696 17740 E linker : warning: unable to get realpath for the library “/data/app/com.google.android.gms-2/oat/arm64/base.odex”. Will use given name.
03-03 21:14:46.148 17696 17740 I DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:204890103
03-03 21:14:46.150 17696 17740 I DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 204890103
03-03 21:14:46.158 17696 17740 D DynamitePackage: Instantiated singleton DynamitePackage.
03-03 21:14:46.158 17696 17740 D DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl

** Logs When Loading an Ad Afterwards **

03-03 21:15:01.426 17696 17696 E Ads : ### This app is using a lightweight version of the Google Mobile Ads SDK that requires the latest Google Play services to be installed, but Google Play services is either missing or out of date.
03-03 21:15:01.437 17696 17893 I Unity : AdFailedToLoad: Invalid request
03-03 21:15:01.437 17696 17893 I Unity : System.EventHandler1:Invoke(Object, TEventArgs) 03-03 21:15:01.437 17696 17893 I Unity : System.EventHandler1:Invoke(Object, TEventArgs)
03-03 21:15:01.437 17696 17893 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo)
03-03 21:15:01.437 17696 17893 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[ ])
03-03 21:15:01.437 17696 17893 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)

Quick google shows this - readlink('/proc/self/fd/21') failed: Permission denied [fd=21] error in Android 6 after adding Admob module to Appcelerator app - Stack Overflow

I saw that before posting, but the answer is to add
true to config.xml, what would be the equivalent of that in Unity?

I assume this file is produced by Admob

It’s an Appcelerator file as far as I can tell. Also AdMob is not the only place with those errors:

03-04 20:08:06.969 16279 16325 I FA      : Tag Manager is not found and thus will not be used
03-04 20:08:06.975 16279 16300 W LibraryVersion: Failed to get app version for libraryName: firebase-auth-compat
03-04 20:08:06.980   608   655 D VoldConnector: RCV <- {200 65 Command succeeded}
03-04 20:08:07.003   608  4410 D VoldConnector: SND -> {66 volume mkdirs /storage/emulated/0/Android/obb/com.duellogames.TripTrap_Android/}
03-04 20:08:07.004   608   655 D VoldConnector: RCV <- {200 66 Command succeeded}
03-04 20:08:07.034 16279 16328 I Unity   : SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 2, Memory = 1835mb
03-04 20:08:07.034 16279 16328 I Unity   : SystemInfo ARM big.LITTLE configuration: 2 big (mask: 0x3), 0 little (mask: 0x0)
03-04 20:08:07.035 16279 16328 I Unity   : ApplicationInfo com.duellogames.TripTrap_Android version 1.9.2 build 9bd5f7cd-3af2-4a29-9a72-dd8d616cb6ea
03-04 20:08:07.035 16279 16328 I Unity   : Built from '2019.4/staging' branch, Version '2019.4.21f1 (b76dac84db26)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Enabled'
03-04 20:08:07.036 16279 16328 E linker  : readlink('/proc/self/fd/52') failed: Permission denied [fd=52]
03-04 20:08:07.036 16279 16328 E linker  : warning: unable to get realpath for the library "/data/app/com.duellogames.TripTrap_Android-1/lib/arm64/libil2cpp.so". Will use given name.
03-04 20:08:07.080 16279 16325 V FA      : Connection attempt already in progress
03-04 20:08:07.250 13328 13328 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs.
03-04 20:08:07.269 13328 13328 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs.
03-04 20:08:07.296 16279 16325 V FA      : Connection attempt already in progress
03-04 20:08:07.333  1103 12451 I NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.icing.service.IcingGcmTaskService started execution. cause:4 exec_start_elapsed_seconds: 296044 [CONTEXT service_id=218 ]
03-04 20:08:07.336 16279 16325 V FA      : Connection attempt already in progress
03-04 20:08:07.350  1103 12012 I NetworkScheduler.Stats: Task com.google.android.gms/com.google.android.gms.icing.service.IcingGcmTaskService finished executing. cause:4 result: 1 elapsed_millis: 53 uptime_millis: 53 exec_start_elapsed_seconds: 296044 [CONTEXT service_id=218 ]

For anyone who might come across the same problem… The AdMob issue got resolved with changing the API Compatibility Level to .NET 4.x. The readlink / Permission denied errors are still there for this device, but they don’t seem to cause any issues now, so I guess they can be ignored.