I have the latest Android Studio IDE installed on my Windows 10 laptop, and it was working fine until my windows operating system made a huge automatic update.
Now,
Simple Answer:
A simple Clean Project
+ Rebuild Project
worked for me
In my case, it was a firewall issue. After adding Android Studio to its whitelist everything is working fine.
I have just synced the Project with Gradle files and it worked
I got around this issue by turning on Offline Mode in the Gradle tool window.
I resumed working on my project after a long time and I was using an Old version of navigation dependency.
after updating version to versions.navigation = "2.3.0"
from versions.navigation = "2.3.0-aplha01"
my issue was resolved.
so in short make sure you are using latest version of gradle and all libraries (compatible with your gradle version).