In my Unity game, recently it became possible to install modifications from archives directly through the game. On Windows and Linux everything works perfectly: the archive is extracted to the right path and the modifications work, to install it you just need to drag the archive to the exe of the game, or just open the file with the same exe (and similarly on Linux); and on Android to install modifications you just need to click on the archive in any file manager and select the game from the list of applications. It works. But there is one BUT: the game did not request read/write access to the internal memory, so when you open the archive just pops up a message that there is no access to the file (access denied). I will not write the details of how the error is displayed, as it is implemented in the C# code of the game through try catch. I dug through a ton of information, did almost everything I could, but the game still just does not request access to files, even in the device settings in the properties of the game in the permissions nothing. What could be the problem? Here is the code of AndroidManifest.xml:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="pub.SoprotivlenieBespolezno.MTS"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.PICK" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
</application>
Found a lot of questions on the forums, where the answer was one - “android.permission.MANAGE_EXTERNAL_STORAGE”. But it didn’t work for me. Besides the main version of Unity 2021.3.x, I tried putting newer 2022.x and 2023.x, but everywhere this problem was present. Also in Project Settings in “Write permission” I selected “External”, but that didn’t solve the problem either, although when the project was still on Unity 2019.x, it worked without changing the contents of AndroidManifest.xml…
Is there any way to solve this problem at all? Or is Unity in the latest versions poorly compatible with Android?