Error message

What went wrong: A problem occurred configuring project ':gallery_saver'. > Could not resolve all files for configuration ':gallery_saver:classpath'. > Could not resolve com.android.tools.build:gradle:4.2.1. Required by: project :gallery_saver > Could not resolve com.android.tools.build:gradle:4.2.1. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.2.1/gradle-4.2.1.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.2.1/gradle-4.2.1.pom'. > Connect to dl.google.com:443 [dl.google.com/157.240.12.50] failed: Connection timed out: connect > Failed to notify project evaluation listener. > Could not get unknown property 'android' for project ':gallery_saver' of type org.gradle.api.Project. > Could not get unknown property 'android' for project ':gallery_saver' of type org.gradle.api.Project. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights.

Solution

change your gradle version in build.gradle.