Android Studio: package com.badlogic.gdx does not exist

I tried migrating my project to Android Studio and somehow in the process I messed up some settings I guess.
Now when I import my project i get an error:

package com.badlogic.gdx. etc does not exist & it sums up all the missing packages.

I tried have gradle reimport the necessary dependencies as suggested in this stackoverflow post:

But it didn’t work.

How do i get my project running again?