AndroidStudio-Solution to solve android studio import github project or other local projects cannot run and compile solution

Today, I used someone else’s SDK on github, but when I cloned it, I found it couldn’t run. I thought it was because the package didn’t download anything. After checking, I found that there was a problem with the gradle version.

Write down and take notes, and solve it later

When importing someone else’s android studio project or a project under github (such as project A), the general failure to run and compile is the inconsistency of gradle. The following describes the solution

1. Open the directory of project A and delete the file in the red box in the figure below

2. Find one of your previous android studio projects, and open the project B that can be run before (such as project B). Open the build.gradle file with Notepad and remember your gradle version number. (For example, mine is 2.3.3)

 

 

3. Open the build.gradle file of Project A

 

 

Modify the gradle version to your own gradle version number. (As shown below) and save.

4. Finally, directly open the project you want to import, compile and run. This is the correct way to import github projects and other people's projects

 

 

 

 

 

Welcome to follow WeChat public account: Coderyang

 

Today, I used someone else’s SDK on github, but when I cloned it, I found it couldn’t run. I thought it was because the package didn’t download anything. After checking, I found that there was a problem with the gradle version.

Guess you like

Origin blog.csdn.net/weixin_44325444/article/details/106905369