Provided herein are RET kinase inhibitors according to the formula:
pharmaceutically acceptable salts thereof, pharmaceutical compositions thereof, and methods for their use in the treatment of diseases that can be treated with a RET kinase inhibitor, including RET-associated diseases and disorders. A, R
1
, n, X
1
, X
2
, X
3
, X
4
, and R
2
have the meanings given in the specification.