In this work, we established a novel theory for the dynamics of oscillating bubbles such as cavitation bubbles, underwater explosion bubbles, and air bubbles. For the first time, we proposed bubble dynamics equations that can simultaneously take into consideration the effects of boundaries, bubble interaction, ambient flow field, gravity, bubble migration, fluid compressibility, viscosity, and surface tension while maintaining a unified and elegant mathematical form. The present theory unifies different classical bubble equations such as the Rayleigh-Plesset equation, the Gilmore equation, and the Keller-Miksis equation. Furthermore, we validated the theory with experimental data of bubbles with a variety in scales, sources, boundaries, and ambient conditions and showed the advantages of our theory over the classical theoretical models, followed by a discussion on the applicability of the present theory based on a comparison to simulation results with different numerical methods. Finally, as a demonstration of the potential of our theory, we modeled the complex multi-cycle bubble interaction with wide ranges of energy and phase differences and gained new physical insights into inter-bubble energy transfer and coupling of bubble-induced pressure waves.