We have obtained multislit spectroscopic observations from 3700 to 9200 Å with Low Resolution Imaging Spectrometer at the Keck I telescope for 31 H ii regions in the disc of the Andromeda galaxy (M31), spanning a range in galactocentric distance from 3.9 to 16.1 kpc. In nine H ii regions we measure one or several auroral lines ([O iii] λ4363, [N ii] λ5755, [S iii] λ6312, [O ii] λ7325) from which we determine the electron temperature (Te) of the gas and derive chemical abundances using the direct Te-based method. We analyse, for the first time in M31, abundance trends with galactocentric radius from the direct method, and find that the Ne/O, Ar/O, N/O and S/O abundance ratios are consistent with a constant value across the M31 disc, while the O/H abundance ratio shows a weak gradient. We have combined our data with all spectroscopic observations of H ii regions in M31 available in the literature, yielding a sample of 85 H ii regions spanning distances from 3.9 to 24.7 kpc (0.19–1.2 R25) from the galaxy centre. We have tested a number of empirical calibrations of strong emission line ratios. We find that the slope of the oxygen abundance gradient in M31 is −0.023 ± 0.002 dex kpc−1, and that the central oxygen abundance is in the range 12+log(O/H) 8.71–8.91 dex (i.e. between 1.05 and 1.66 times the solar value, for 12+log(O/H)⊙ = 8.69), depending on the calibration adopted. The H ii region oxygen abundances are compared with the results from other metallicity indicators (supergiant stars and planetary nebulae). The comparison shows that H ii region O/H abundances are systematically ∼0.3 dex below the stellar ones. This discrepancy is discussed in terms of oxygen depletion on to dust grains and possible biases affecting Te-based oxygen abundances at high metallicity.