12. Find the integer solutions of the indeterminate equation $x^{6}+x^{3} y=y^{3}+2 y^{2}$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
12. Let $(x, y)$ be the integer solution of the equation, then when $x=0$, $y^{2}(y+2)=0$, we get $y=$ 0 or -2. When $y=0$, $x^{6}=0$, we get $x=0$. It is known that when $x, y$ have one equal to zero, the solutions are $(x, y)=(0,0)$ or $(0,-2)$.

Below, we discuss the case where $x y \neq 0$. For any prime factor $p$ of $y$, let $p^{m} \| y$, then $p \mid x^{6}$, hence $p \mid x$. Suppose $p^{n} \| x$, there are two possibilities.
(1) $p$ is an odd prime, then $p^{2 m} \|\left(y^{3}+2 y^{2}\right)$. And $x^{6}+x^{3} y=x^{3}\left(x^{3}+y\right)$. If $3 n \leq m$, then we get $3 n+m=2 m$, which implies $m=3 n$. Therefore, we always have $m=3 n$.
(2) $p=2$, if $m \geqslant 2$, then $2^{2 m+1} \|\left(y^{3}+2 y^{2}\right)$, similarly to (1) we get $m=3 n$ or $3 n-1$.

Using the conclusions from (1) and (2), we can set $(x, y)=\left(a b, 2 b^{3}\right),\left(a b, b^{3}\right)$ or $\left(a b, \frac{b^{3}}{2}\right)$, where $a, b \in \mathbf{Z}$. Substituting into the original equation, we get
$1^{\circ} a^{6}+a^{3}=b^{3}+2$,
$2^{\circ} a^{6}+2 a^{3}=8 b^{3}+8$,
$3^{\circ} \quad 8 a^{6}+4 a^{3}=b^{3}+4$.
For equation $1^{\circ}$, if $a>1$, then
$$\left(a^{2}+1\right)^{3}>b^{3}=a^{6}+a^{3}-2>\left(a^{2}\right)^{3},$$

no solution. If $a b^{3}>\left(a^{2}-1\right)^{3},$

also no solution. Hence $a=0, x=0$ or $a=1, b=0, y=0$, both contradict $x y \neq 0$.
For equation $2^{\circ}$, if $a>0$, then
$$\left(a^{2}+1\right)^{3}>(2 b)^{3}=a^{6}+2 a^{3}-8>\left(a^{2}\right)^{3},$$

no solution. If $a(2 b)^{3}>\left(a^{2}-1\right)^{3},$

also no solution. For $a=-2,-1,0$, all lead to $x y=0$.
For equation $3^{\circ}$, if $a>1$, then
$$\left(2 a^{2}+1\right)^{3}>b^{3}=8 a^{6}+4 a^{3}-4>\left(2 a^{2}\right)^{3} .$$

If $a b^{3}>\left(2 a^{2}-1\right)^{3}$

Hence, only $a \in\{-1,0,1\}$. Only when $a=1, b=2$, there is a solution $(x, y)=(2,4)$ such that $x y \neq 0$.

In summary, the integer solutions of the equation are $(x, y)=(0,0),(0,-2)$ or $(2,4)$.