Android Studio imports the project to run successfully (nanny-level tutorial)

Catalog

  1. Download the resource package

  2. Create a new project

III. Replace the configuration file

  1. Open Android Studio

1. Download the resource package

Download the resource package you get to the location you can find and then decompress it for easy operation.

2. Create a new project

If you already have a new project, you don’t need to create it. However, it should be noted that if the root directory contains buil. Gradle files after you decompress the downloaded resource package, then it means that your new project should match it, that is to say, the source coder uses Groovy DSL

If it contains build. Gradle. KTs files, it means that you choose the other two when you create the new project.

III. Replace the configuration file

Open your newly created project in Explorer, find the three files I marked, and copy them.

Then open the android project resource package you downloaded, also in Explorer.

Delete the. Gradle. Idea gradle three files under the folder (if there is no one, don’t worry about it. If there is only one of the three, then someone will delete it)

Then paste the three files you copied here.

4. Open Android Studio

In Android Studio, open the project file you downloaded and completed the above operations.

In general, the program will automatically adapt to debugging, wait for a while, do not worry.

If the JDK and gradle versions of your android studio match the version of the project you downloaded, you can basically run it directly and wait for the program to configure itself.

If the version does not match (the mismatch here includes the mismatch described above, and another situation is that your JDK and your own gradle version number do not match, and the matching version numbers can be searched on the Internet), then the following error will occur:

Here’s the point:

Click file — > project Structure

Click Project, here will show your gradle version number and android version number, click the right side of the text box to choose to adapt, if not, you need to download, the official website has.

Change the two to match the version number, click OK, the program will automatically configure. Wait for a few minutes or even ten minutes:

At this point, you will find that the green mark of app in the project menu bar disappears, indicating that the configuration is successful!