FileSystem.writeFile only work in live mode

Hello, I’m having quite a problem now.
Running the app using ionic capacitor run android --livereload --external worked as expected. Reading and writing normally to the native filesystem.
But whenever I tried to remove those flags for live mode, The file could not be written anymore, reading still possible though.
I’ve tried spliting the process and do it manually step by step (vite build, cap add,…) but still couldn’t find any problem.
Additional info:
The project was created using ionic cli 7 with the blank template.