I know about this questions:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
Could not resolve com.android.support:appcompat-v7:26.1.0 [dup
Just go to File\Settings\Gradle. Deselect the "Offline work" box. Now you can connect and download any necessary or missing dependencies