Can the key-generation algorithm always be uniform? Assume that the encryption uses $n$-bit keys to encrypt $l(n)$-length messages.

If a symmetric key encryption scheme is defined as $\Pi_{1} = ( \mathrm{Enc}, \mathrm{Dec} )$, then for every $x_{0}, x_{1} \in \{0,1\}^{l(n)}$,
$$ \left\vert \Pr\left[ A (\mathrm{Enc}_{U_{n}}(x_{0})) = 1\right] - \Pr\left[ A (\mathrm{Enc}_{U_{n}}(x_{1})) = 1\right] \right\vert &lt; \varepsilon(n) $$
if it is computational secure.

And if a symmetric key encryption scheme is defined as $\Pi_{2} = ( \mathrm{Gen}, \mathrm{Enc}, \mathrm{Dec} )$, then for every $x_{0}, x_{1} \in \{0,1\}^{l(n)}$,
$$ \left\vert \Pr\left[\mathrm{Gen}(1^{n})=k; A (\mathrm{Enc}_{k}(x_{0})) = 1\right] - \Pr\left[\mathrm{Gen}(1^{n})=k; A (\mathrm{Enc}_{k}(x_{1})) = 1\right] \right\vert &lt; \varepsilon(n) $$
if it is computational secure.

The definition of security is different because the definition of the encryption  is different.
Generally, we do not require that the distribution of $\mathrm{Gen}$ must be uniform.
But it seems that the uniform distribution is always the best.
So, if $\Pi_{2}$ is a computational secure scheme, I want to know whether there exists a PPT algorithm $\mathrm{Gen}'$ which is uniform such that
$$ \left\vert \Pr\left[\mathrm{Gen}'(1^{n})=k; A (\mathrm{Enc}_{k}(x_{0})) = 1\right] - \Pr\left[\mathrm{Gen}'(1^{n})=k; A (\mathrm{Enc}_{k}(x_{1})) = 1\right] \right\vert &lt; \varepsilon(n) $$
For any symmetric encryption scheme, it is not a loss of generality to assume that the key is uniformly distributed: you can let the key be the random coins of the key generation algorithm $\mathcal G$, and incorporate the deterministic part of $\mathcal G$ (i.e., how it generates the key from its random coins) into the encryption and decryption algorithms.

For asymmetric encryption schemes, the same applies to the private key.