Search Issue Tracker
Fixed in 2019.3.X
Fixed in 2018.4.X, 2019.1.X, 2019.2.X
Votes
4
Found in
2018.2.0f2
Issue ID
1063768
Regression
No
[UWP] [IL2CPP] File.Exists method returns false
Steps to reproduce:
1. Download and open attached project
2. Switch platform to UWP
3. Target any device and build the project on IL2CPP backend
4. Open Visual Studios solution
5. Add restricted "broadFileSystemAccess" capability to Package manifest
6. Build project (Debug x64 Local Machine)
7. When the app launches it will open file explorer. Select any text file in it
Expected results: the method File.Exists(path) returns true
Actual results: the method File.Exists(path) returns false
Workaround: Use UWP StorageFile APIs to manipulate files outside of folders normally accessible for the app.
Reproduced with: 2018.3.0a6, 2018.2.1f1, 2018.1.9f1, 2017.4.8f1
Note: Not reproducible on .NET backend
-
Tautvydas-Zilys
Aug 22, 2018 17:55
@Spiece, no, it's because IL2CPP does not virtualize UWP file access at this time.
-
spierce
Aug 22, 2018 17:46
Is this because UnityEngine.Windows.File is preferred on UWP?
If so, it would be nice if there were compile-time (or at least runtime) errors indicating that this is what should be used on this platform.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2019.3):
By default "File system" is disabled in app. To enable it you will need to go to App Setting -> App permissions.