A novel online antenna array calibration method is presented in this paper for estimating direction-of-arrival (DOA) in the case of uncorrelated and coherent signals with unknown gain-phase errors. Conventional calibration methods mainly consider incoherent signals for uniform linear arrays with gain-phase errors. The proposed method has better performance not only for uncorrelated signals but also for coherent signals. First, an on-grid sparse technique based on the covariance fitting criteria is reformulated aiming at gain-phase errors to obtain DOA and the corresponding source power, which is robust to coherent sources. Second, the gain-phase errors are estimated in the case of uncorrelated and coherent signals via introducing an exchange matrix as the pre-processing of a covariance matrix and then decomposing the eigenvalues of the covariance matrix. Those parameters estimate values converge to the real values by an alternate iteration process. The proposed method does not require the presence of calibration sources and previous calibration information unlike offline ways. Simulation results verify the effectiveness of the proposed method which outperforms the traditional approaches.