Mobile Android 11 and Terraria

Jbro129

Official Terrarian
I wouldn't necessarily call this a bug but this does affect all android devices running android 11 and above.

Since mobile terraria 1.3 its files have been in its android/data directory. Android 11 introduces a feature called scoped storage, and long story short scoped storage stops users from being able to access Terraria's android/data directory as well as any other apps android/data in file browser apps. The reason why this matters is because now users can no longer access Terraria's worlds and players folders.

Maybe on android 11 devices the Terraria files can be stored somewhere on the /sdcard or another directory that is accessible on android 11?

Current worlds directory: /sdcard/Android/data/com.and.games505.TerrariaPaid/Worlds
Current players directory: /sdcard/Android/data/com.and.games505.TerrariaPaid/Players

Possible new Android 11 worlds directory: /sdcard/Terraria/Worlds or /sdcard/com.and.games505.TerrariaPaid/Worlds
Possible new Android 11 players directory: /sdcard/Terraria/Players or /sdcard/com.and.games505.TerrariaPaid/Players

I have come across 3 file browsers that use a workaround to browse the android/data directories. The workaround that these apps have implemented will probably be patched in the future as the whole point of scoped storage is so apps can't read or write to other apps files.
The file browsers that currently have this workaround are X-plorer, Explorer, and Solid Explorer.

I think it would be best if the Terraria files are moved to another directory if running Android 11+ instead of needing to use specific browsers that have a workarounds that won't work forever.
 
I wouldn't necessarily call this a bug but this does affect all android devices running android 11 and above.

Since mobile terraria 1.3 its files have been in its android/data directory. Android 11 introduces a feature called scoped storage, and long story short scoped storage stops users from being able to access Terraria's android/data directory as well as any other apps android/data in file browser apps. The reason why this matters is because now users can no longer access Terraria's worlds and players folders.

Maybe on android 11 devices the Terraria files can be stored somewhere on the /sdcard or another directory that is accessible on android 11?

Current worlds directory: /sdcard/Android/data/com.and.games505.TerrariaPaid/Worlds
Current players directory: /sdcard/Android/data/com.and.games505.TerrariaPaid/Players

Possible new Android 11 worlds directory: /sdcard/Terraria/Worlds or /sdcard/com.and.games505.TerrariaPaid/Worlds
Possible new Android 11 players directory: /sdcard/Terraria/Players or /sdcard/com.and.games505.TerrariaPaid/Players

I have come across 3 file browsers that use a workaround to browse the android/data directories. The workaround that these apps have implemented will probably be patched in the future as the whole point of scoped storage is so apps can't read or write to other apps files.
The file browsers that currently have this workaround are X-plorer, Explorer, and Solid Explorer.

I think it would be best if the Terraria files are moved to another directory if running Android 11+ instead of needing to use specific browsers that have a workarounds that won't work forever.
try asking the developers of the Android phones as well to change the game files location to previous if you are wanting to access the files
 
try asking the developers of the Android phones as well to change the game files location to previous if you are wanting to access the files
Game file locations can be located wherever the game sets it too. It's not something managed by the phones manufacturer or android. Its just happens to be that the place where mobile Terraria keeps its files (As well as a lot of apps) are no longer accessible due to scoped storage.
 
Game file locations can be located wherever the game sets it too. It's not something managed by the phones manufacturer or android. Its just happens to be that the place where mobile Terraria keeps its files (As well as a lot of apps) are no longer accessible due to scoped storage.
ah, ok, the devs would then have to change the file location for the iOS version of terraria as well
 
ah, ok, the devs would then have to change the file location for the iOS version of terraria as well
This issue doesn't affect ios at all. DRS can just implement some code that checks what Android version the user is on and adjust the save locations accordingly. DRS could add this without affecting ios users.

Edit: Using this, if getSDKInt() returns a values greater than or equal to 30 then use a different location.
Edit2: It really should be 29 instead of 30 since scoped storage is optional on sdk 29 (Android 10) but its enabled by default on sdk 30 (Android 11).
 
Last edited:
As a follow up on this issue I have come up with 2 solutions.

Solution #1: Change the directory for everyone. Upon opening Terraria, it checks its old android/data directory and moves anything there to another directory that's accessible in android 10-11. Use a new /sdcard/Terraria or whatever directory for all saves. Terraria checks the previous android/data directory every time the game is opened to make sure no worlds or players are located in its old android/data directory and if there are any then they are copied or moved to the new one.

Solution #2: Use a different directory if Terraria is being used on an Android 10 or 11 device. Terraria checks the sdk version of the device and if its 29 or 30 then its android 10 or 11. Sdk 29 and 30 will have the saves located in an android 10-11 friendly area while anything below 29 will use the old location. (I linked to some C# code that DRS could use to determine a devices sdk version earlier). The only issues with this solution is if a device upgrades its software from 9 to 10 then Terraria will need to migrate its files to a new Android 10-11 friendly area.

It would be better to just do solution #1 as it migrates the location of the Terraria worlds and players be default and wouldn't be affected by device upgrades.

Solution #1 is the best I could think of. If anyone can think of a better solution then please let me know!

Edit: The only other options I can think of is an import and export area in Terraria's settings where users can move worlds and players back and forth. (This settings area would obviously be only visible if Terraria is being ran on android.) DRS could use this to determine if a device is on android.
Edit2: DRS could use androids Storage Access Framework (SAF) to manage files on android 10 and 11.
 
Last edited:
Proceed with CAUTION !!!!!!

Fixed at the moment on Android 11 but you need ADB(Android Debug Bridge) for this.
You need the ADB (Android Debug Bridge) for this. Link to XDA-Developers: [OFFICIAL][TOOL][WINDOWS] ADB, Fastboot and Drivers - 15 seconds ADB Installer v1.4.3
If Links are not allowed search in Google "Adb installer XDA-developers"

Enable USB-Debugging in Android Developers options, mostly under (Settings -> About Phone) Tap the Build Number multiple Times
Connect your Android Device via an USB-Cable on your PC, click the Promp on your Phone to Allow (+click always allow)
Open Windows Powershell where adb.exe is located (Keep Pressed L-SHIFT and Right-Click -> works in every Directory)

Type line after Line:
cmd.exe
adb devices (one Device should show up, if not it doesn't work, Check if ADB is properly installed)
adb shell
pm grant com.and.games505.TerrariaPaid android.permission.WRITE_EXTERNAL_STORAGE
pm grant com.and.games505.TerrariaPaid android.permission.Read_EXTERNAL_STORAGE
exit


Terraria should now be saving again.
The Reason this happens is, Terraria doesn't have write and Read Permission on the Phone and this can't be set on your phone, even if it should...so we did that fix manually via ADB.

PS: Save Directory should be .../Internal Storage/Android/data/com.and.games505.TerrariaPaid
under there are all save files located ( Worlds, Player etc.)

I hope i could help you out !!!
 
Last edited:
Back
Top Bottom