Error: 'I can't write on file 'Main.pdf'

I suddenly keep getting the error message in the title. I have no idea what I did wrong as I did not have this problem before. I know this error can occur if the corresponding pdf file is opened, but this is not the case.

When I run biber I get the error: 'Entity: line 1959: parser error : expected '>'

Any ideas on how this can be solved? My preamable is the following:

\PassOptionsToPackage{table,xcdraw}{xcolor}
\documentclass[a4paper,12pt]{report}
\newcommand{\argmin}{\arg\!\min}
\usepackage[backend=biber, natbib=true, maxcitenames = 2, style=authoryear, uniquename=false]{biblatex}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath,amsfonts}
\usepackage{smartdiagram}
\usepackage{float}
\smartdiagramset{circular distance=4cm,
font=\normalsize,
text width=2.5cm,
arrow line width=0.2cm
}
\newsavebox{\mybox}
\savebox{\mybox}{%
\smartdiagram[circular diagram]{Insured \\ policy holder,Insurer \\ company}
}

\begin{document}[a4paper,12pt]

• It is possible that the PDF is not properly constructed because there were fatal errors during compilation. The fact that you have \begin{document}[a4paper,12pt] is a sign that there likely are other, more damning errors. It should just be \begin{document} unless you mean to print the [a4paper,12pt] in the actual output. The \PassOptionsToPackage is pretty unorthodox too.
– jon
Apr 27 '15 at 15:15
• Maybe related with: tex.stackexchange.com/questions/240860/… Apr 27 '15 at 16:10

Since you didn't give more details about the problem (like what compiler are you using), it is hard to found out what is the problem. However, I have reorganized your code, maybe it solves your problem:

\documentclass[a4paper,12pt]{report}
\usepackage[table,xcdraw]{xcolor}
\usepackage[backend=biber, natbib=true, maxcitenames = 2, style=authoryear, uniquename=false]{biblatex}
\usepackage{algorithm}
\usepackage{caption}
\usepackage{amsmath,amsfonts}
\usepackage{smartdiagram}
\usepackage{float}
\newcommand{\argmin}{\arg\!\min}
\smartdiagramset{circular distance=4cm,
font=\normalsize,
text width=2.5cm,
arrow line width=0.2cm
}
\newsavebox{\mybox}
\savebox{\mybox}{%
\smartdiagram[circular diagram]{Insured \\ policy holder,Insurer \\ company}
}

\begin{document}

\printbibliography

\end{document}

• Thank you for the reaction. I am using texmaker and miktex. The reorganized code, however, seems not to do the job. Apr 27 '15 at 17:37
• Some other possible relevent information: when I run biber I get the error: 'Entity: line 1959: parser error : expected '>' </bcf:constrain ^ Entity: line 1959: parser error : Opening and ending tag mismatch: constraint line 1954 and constrain </bcf:constrain ^'. This also was not happening before. Apr 27 '15 at 17:56
• Did you check your .bib file for any invalid entry? Apr 27 '15 at 19:12