'Gradle project in Android Studio not importing libraries

So I downloaded a template from http://www.androidbootstrap.com/ and I was able to compile and deploy it after changing a few things. However, there are errors in every java and layout file. All of the libraries are showing up with red underlines in the imports section and all of their functions are doing the same. It's not able to find the functions when I'm editing, but when building it seems to be fine. What can I do to fix this?



Solution 1:[1]

Caches files must be corrupted.

Go to menu File and select Invalidate Caches / Restart

Solution 2:[2]

I had a similar problem. In my case the solution was that I had to add maven { url 'https://jitpack.io' } in settings.gradle.

Solution 3:[3]

I don't use Android Studio, so I can't say for sure. However, I do use its cousin IntelliJ. It sounds like Studio doesn't know about your Gradle build file. In IntelliJ, the Gradle plugin needs to be installed, and you need to add the build file to the project (or create a new project from an existing file). I would think those would be automatic in Studio. Regardless, try to see if something comparable applies for you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Androiderson
Solution 2 blazc
Solution 3 Vidya