Fix the error ‘I can’t write on file `document.pdf’

output

I attach the document code. I don't understand what's wrong. Before that, everything worked, but after updating the MiKTeX packages, this error appeared. I work in the Texstudio program.

\documentclass[14pt]{ncc}
\usepackage[a4paper, left=2cm, right=2cm, top=2cm, bottom=2cm, headsep=0.7cm, footskip=1cm]{geometry}
\usepackage[T2A]{fontenc} % Поддержка русских букв
\usepackage[utf8]{inputenc} % Кодировка utf8
\usepackage[english,russian]{babel} % Языки: русский, английский
\usepackage{fontspec} % Настройка для подключения
\setmainfont{Times New Roman} % шрифта Times New Roman
\usepackage{indentfirst} % Красная строка
\usepackage{xcolor} % Пакет для работы с цветами
\usepackage{hyperref} % Гиперссылки
%\usepackage{amsmath,amssymb,amsthm,amsfonts,amscd}
\usepackage{amsmath,amssymb}
\usepackage{esdiff}
\usepackage{graphicx}
\pagestyle{plain} % Номера страниц ставятся снизу и по центру
\usepackage{enumitem}
\setlist{nolistsep, labelsep=0.2cm, leftmargin=0cm} % Отступы номеров
% Настройка некоторых параметров ссылок
\hypersetup{
    colorlinks = true, % Ссылки цветные? - Да
    linkcolor = {blue!50!black}, % Цвет внутренних ссылок
    citecolor = {red!75!black}, % Цвет ссылок на библиографию
    urlcolor = red, % Цвет ссылок на внешние (Интернет) ресурсы
}

\DeclareSymbolFont{lsymb}{U}{euex}{m}{n}
\DeclareMathSymbol{\intop}{\mathop}{lsymb}{"52}
\DeclareMathSymbol{\ointop}{\mathop}{lsymb}{"48}
\DeclareMathSymbol{\smallint}{\mathop}{lsymb}{"52}

\begin{document}
    Текст
\end{document}

Best Answer

The cause of the error was Avast antivirus. He perceived the LuaLaTeX compiler as malicious. When the process started lualatex.exe, the antivirus issued a message in which I clicked the "Allow application" button, and the error disappeared.

Related Question