Improve error message for missing imports (#12494)

Change-Id: Ic320ac6f54e928939773495a5168ac674d6a1a33