In Android Studio switch to Project perspective (not Android perspective).
Make sure that your project follows the gradle plugin's default structure (i.e. project_dir/app/src/main/java...)
Delete all build folders and subfolders that you see.
In the toolbar click Build -> Clean Project, then Build -> Rebuild Project.
Try to run the project.