I'm using MiKTeX 22.7 on windows 10 and when I try to compile any file I get the error: "can't write on filename.pdf". I'm aware this question has already been asked, such as here or here, but I've tried all solutions proposed and nothing worked.
Notice that the problem appeared suddenly, without an apparently explicable reason. I use MiKTeX on a daily bases and I was working on the exact same file just the day before the issue started to occur. The next day I opened the file, recompiled it before doing any change and it would raise the "can't write on filename.pdf" error.
What I tried to do:
- recompile old tex documents that always used to work
- delete the existing pdf file and try to recompile
- create a new simple hello world tex file
- create such file in a different directory
- change protection settings of pdf reader
- temporarily disable the antivirus
What I concluded:
- the problem does not lie in the tex document
- the problem does not lie in the folder
- the problem is not related to pdf security properties
- the problem is not related to antivirus
Also note that I'm not using any cloud service that could lead to problems due to syncing. That being said I feared it was an issue with this MiKTeX build, so I opened another PC with the same version of MiKTeX, Windows, antivirus and pdf reader and things worked correctly there.
As you can see I'm totally lost on what the problem could be related to or how to solve it.