2. The equation $x^{2}-2 a \sin (\cos x)+a^{2}=0$ has only one solution. Then the real number $a=$
2.0 or $2 \sin 1$.

Let $f(x)=x^{2}-2 a \sin (\cos x)+a^{2}$, then $f(x)$ is an even function.
Thus, $f(0)=0$, that is
$$
a^{2}-2 a \sin 1=0 \text {. }
$$

Solving this, we get $a=0$ or $a=2 \sin 1$.