If android studio cannot run project, in most cases,it is the gradle question. Because it cannot build the project successfully for you. So we should fix our gradle first. Here are some tips:

1.Check if the gradle is OK for you.

you can click the gradle button,it is always shown on the sidebar. It will show a window box in which there are many gradle plugins,something like the following picture:

What should you do first, when android studio cannot run project_安卓


The gradle is not OK,if the window box is empty.

2.Check if the version of gradle plugin corresponds to the gradle which you download.
If the gradle is not OK,you should do this step!
For example:
if the version of the plugin is 4.1.1 in ​​​build.gradle​​ of project level:

...
dependencies{
classpath 'com.android.tools.build:gradle:4.1.1'
}

So the configuration in ​​gradle-wrapper.properties​​ should be like this:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

It’s better to make sure everything is OK with the configuration,before you try another way to solve your problem.