Failed to open descriptor file (android)

Same for me !! Downloaded SKD version 28, I set it up in Target SKD version, and it worked ! Thank you <3

I got a similar issue on my Android 13 device, when targeting SDK 33.

After digging a little bit, it looks like Unreal can’t read files in /storage/emulated/0 because it the permissions it requests (READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE) serve a different purpose in Android 11+; it doesn’t allow access to this “sensible” storage.

So, in Android 11+, the other permission to request is MANAGE_EXTERNAL_STORAGE. It’s considered as a “dangerous” permission, so you need to do extra steps to enable it than just adding the permission to the manifest.

There’s the quick and easy solution to just have TargetSDK ≤ 30 in the Project Settings, which works because it ignores the updated storage permission rules for backwards-compatibility… But then you need to remember to set the Target SDK to the latest version when publishing to the Play Store. And you might have (really rare) surprises with Android’s backwards-compatibility when doing so.

If you’re determined to keep the Target SDK to the latest version, here goes a temporary solution if you can’t edit the engine source code:

  1. Go to Project Settings > Android, and add the android.permission.MANAGE_EXTERNAL_STORAGE permission
  2. Make sure AndroidFileServer is disabled (else, AFS will never start and you’ll be stuck)
  3. Deploy your app to your device in Unreal
  4. Once the app has launched, close it because it will furiously fail to get the descriptor file
  5. Open up a terminal and run the following command to actually enable access to files, and replace [PACKAGE] with the full package name of your app (like com.somestudio.insanegame)
    adb shell appops set --uid [PACKAGE] MANAGE_EXTERNAL_STORAGE allow
    
    Or, you can go to your phone’s settings app and manually enable the permission for “manage all files”.
  6. Reopen your app and relieve

This solution is even less ideal because you have to remember to remove the android.permission.MANAGE_EXTERNAL_STORAGE permission when publishing to the Play Store. However, you can fix this problem entirely without any extra steps by editing the engine source code, or by making a UPL plugin which automates some of the stuff…

This issue really needs to be fixed in later UE versions, the fix is really just one permission and one adb command.

10 Likes

For me the fix in Unreal Engine 5.2 is to disable Android File Server from Project Settings.

And here are my Android Settings:

1 Like

You are my lord and savior!

1 Like

The real Lord and Savior showed it to me. I’m glad it works! :slight_smile:

1 Like

Same issue launching on android for UE5.2 here, but package apk then install would work.
tried your solution(uncheck androidfileserver and check useexternalfilesdir) still not working, any other setting needed? Thx a lot

Hi,

It worked for me

1 Like

@Thoeme Thank you for your solution. It is working for me.

Add android:requestLegacyExternalStorage=“true” to Project Settings - Android - Extra Tags for application node by hitting “+” icon

2 Likes

This is what finally made it work for me, thank you.

I have a very bad feeling moving forward with my project though, what happens when I am ready to publish… You mention “remember to remove the permission when publishing”. Won’t the published game have the initial bug “Failed to open descriptor file”?

How are we meant to deal with this, what is the official solution to this problem? There are so many threads about this problem but there does not seem to be any proper solution.

While publishing the game , does the bug “failed to open descriptor file” error still exist ?? or is there is any other solution. please update me.

for when when publishing the failed to open descriptor file massage is not showing but the game is also not working it stuck at first screen

After trying various solutions suggested in this thread, the issue was resolved with the following configuration:

Environment

  • Development Environment: Windows 11
  • Unreal Engine: 5.4.3
  • Device: Pixel 4a (Android 13)

Settings

  • Minimum SDK Version: 26
  • Target SDK Version: 33
  • Extra Permissions: android.permission.MANAGE_EXTERNAL_STORAGE
  • Use AndroidFileServer: Unchecked

After transferring the app, execute the following

adb shell appops set --uid [PACKAGE] MANAGE_EXTERNAL_STORAGE allow

Which NDK and SDK version where you using? Also any specific API level for NDK & SDK?

Im using the below SDK Config and all the same settings as you, but is failing with a SEGV_MAPPER Null Pointer Dereference when the app loads in my android device: