Wrong Application.dataPath on Android using Build and Run?

On PC, Application.streamingAssetsPath will be something like:
C:\Program Files (x86)\Steam\steamapps\common\GameName\GameName_Data\StreamingAssets

On Android, when I use Build And Run onto my stock Pixel 3, Application.streamingAssetsPath is:
jar:file:///data/app/~~twQzWYXhkTFpnqzrD8Yrug==/com.NorthwayGames.GameName-YpsXk6xdBgfVaP3D5XRwzw==/base.apk!/assets

And Application.dataPath is:
/data/app/~~twQzWYXhkTFpnqzrD8Yrug==/com.NorthwayGames.GameName-YpsXk6xdBgfVaP3D5XRwzw==/base.apk

Neither of these folders is accessible; Directory.Exists fails and my game breaks. The random character strings are different every time I hit Build And Run.

If I immediately hit Patch and Run without changing any code, Application.streamingAssetsPath is:
file:///data/data/com.NorthwayGames.GameName/pram-shadow-files/assets
Directory.Exists also fails with this folder, until I strip the “file://” from the front.
This streaming assets path DOES work, I can load my files and run my game:
/data/data/com.NorthwayGames.GameName/pram-shadow-files/assets

If I hardcode “/data/data/com.NorthwayGames.GameName/pram-shadow-files”, all builds work regardless of what Application.dataPath or Application.streamingAssetsPath returns. But I obviously can’t do that because the real location may be different for every device.

What’s going wrong here? Is this a problem with the build, or with the deployment, or what? How am I supposed to load a file from streaming assets on Android?

Ah, oh, looks like the problem might be I shouldn’t be using Directory or File to reference StreamingAssets on Android at all, I need to use an asynchronous WWW call instead: Unity - Manual: Streaming Assets

I was confused because I CAN use Directory.Exists or File.ReadAllText after deploying with a patch, but I guess it unpacks the files in a more accessible way for some reason. Also confusing that the patch includes StreamingAsset files which did not change. And that those pram-shadow-files stick around from previous builds, because patch files don’t get deleted when the app is uninstalled?

Just… confusing all around. Watch out for Patch And Run, it’s real different from Build And Run.

Normally data and streaming assets are inside apk (or obb), both of which are zip files, so regular file/directory accessors wont work, you need the ones that are capable of reading zip archives.
Patch and run does push files to device and the app then reads those files instead of the ones from inside apk. You need to clear application data in order to delete those files. The shadow files are for faster iteration when developing, in the end you still have to do a full clean build and test it.