Conjugated polymers, in general, are unstable when exposed to air, solvent, or thermal treatment, and these challenges limit their practical applications. Therefore, it is of great importance to develop new materials or methodologies that can enable organic electronics with air stability, solvent resistance, and thermal stability. Herein, we have developed a simple but powerful approach to achieve solvent-resistant and thermally stable organic electronic devices with a remarkably improved air stability, by introducing an azide cross-linkable group into a conjugated polymer. To demonstrate this concept, we have synthesized polythiophene with azide groups attached to end of the alkyl chain (P3HT-azide). Photo-cross-linking of P3HT-azide copolymers dramatically improves the solvent resistance of the active layer without disrupting the molecular ordering and charge transport. This is the first demonstration of solvent-resistant organic transistors. Furthermore, the bulk-heterojunction organic photovoltaics (BHJ OPVs) containing P3HT-azide copolymers show an average efficiency higher than 3.3% after 40 h annealing at an elevated temperature of 150 C, which represents one of the most thermally stable OPV devices reported to date. This enhanced stability is due to an in situ compatibilizer that forms at the P3HT/PCBM interface and suppresses macrophase separation. Our approach paves a way toward organic electronics with robust and stable operations.