Are the kG-strength magnetic fields observed in young stars a fossil field left over from their formation or are they generated by a dynamo? We use radiation non-ideal magnetohydrodynamics simulations of the gravitational collapse of a rotating, magnetized molecular cloud core over 17 orders of magnitude in density, past the first hydrostatic core to the formation of the second, stellar core, to examine the fossil field hypothesis. Whereas in previous work we found that magnetic fields in excess of 10 kG can be implanted in stars at birth, this assumed ideal magnetohydrodynamics (MHD), i.e. that the gas is coupled to the magnetic field. Here we present non-ideal MHD calculations which include Ohmic resistivity, ambipolar diffusion and the Hall effect. For realistic cosmic ray ionization rates, we find that magnetic field strengths of $lesssim$ kG are implanted in the stellar core at birth, ruling out a strong fossil field. While these results remain sensitive to resolution, they cautiously provide evidence against a fossil field origin for stellar magnetic fields, suggesting instead that magnetic fields in stars originate in a dynamo process.