Organic-inorganic hybrid perovskites in high-efficiency solar cells are prone to degradation at elevated temperatures, especially in the presence of water moisture. A hole-transporting conjugated copolymer (abbreviated as p-NP-E) characteristic of alternating N-annulated perylene and 3,4-ethylenedioxythiophene backbones, to achieve thermostable perovskite solar cells (PSCs) via controlling gas permeation and thus perovskite decomposition is reported. p-NP-E can be conveniently prepared via Pd-catalyzed direct arylation polycondensation. The air-doped p-NP-E composite film containing nonvolatile 4-tert-butylpyridinium bis(trifluoromethanesulfonyl)imide presents a higher hole mobility and an improved conductivity in comparison with the control based on the state-of-the-art polymer, p-TAA, leading to more efficient PSCs. More critically, the p-NP-E based hole transport layer is not only morphologically more heat-resistant, but also features a lower solubility coefficient and diffusion coefficient of both environmental water molecules and gaseous products such as CH 3 I and CH 3 NH 2 from the thermal decomposition of perovskite, enabling the fabrication of 21.7%-efficiency, 85 °C durable solar cells.