This problem happens intermittently for different libraries and different projects. When trying to import a library, the package will be recognized, but the class name can\'
Simple Restart worked for me.
I would suggest first try with restart and then you may opt for invalidating the cache.
PS : Cleaning out the system caches will result in clearing the local history.