  We report a measurement of the $D^0$ and $D^+$ lifetimes using $D^0\to
K^-\pi^+$ and $D^+\to K^-\pi^+\pi^+$ decays reconstructed in $e^+e^-\to
c\bar{c}$ data recorded by the Belle II experiment at the SuperKEKB
asymmetric-energy $e^+e^-$ collider. The data, collected at center-of-mass
energies at or near the $\Upsilon(4S)$ resonance, correspond to an integrated
luminosity of $72\,{\rm fb}^{-1}$. The results, $\tau(D^0) =
410.5\pm1.1\,{\rm(stat)}\pm0.8\,{\rm(syst.)}\,{\rm fs}$ and $\tau(D^+) =
1030.4\pm4.7\,{\rm(stat)}\pm3.1\,{\rm(syst.)}\,{\rm fs}$, are the most precise
to date and are consistent with previous determinations.
