How to properly fix "Failed to open descriptor file" error(Android)

I was getting this error despite tying to solve it in a multitude of ways as mentioned in other forums. None of them worked for me, except adding the permission for allowing to manage external storage in project settings. Once I installed this package on my phone,I was required to manually go to Android device settings and search for “All files access” and find the app to set it’s permission to true. This is a long way to just get a glimpse of what the app does. If I package this app and ship it to Google Play Store, it will make users averse from my app because they won’t be able to open it. I tried in Android 10, 11, 12 and 13. None of them worked without this series of settings. Is there a better way to fix this problem, or this is the only way of doing things? Please help me