Build Android Studio offline development environment

introduction:        

        Because of Android development, building a development environment requires connecting to the Internet and accessing the external network. Sometimes the download speed is very slow, especially in a poor network environment, and the project may fail to build. Therefore, it is necessary to learn how to build an offline development environment.

1. Install Android Studio and sdk, this part needs to be downloaded and installed by the reader. Download address: Download Android Studio & App Tools - Android Developers

2. Download the gradle project to automatically build open source tools, enter the page to find the version you want, the version does not need to be too high. download link:

Gradle | Releases

3. After all the above requirements are ready, open Android Studio and create a new project normally. After creation, the next step is very important, turn on offline mode.

 

 4. Find the gradle directory in the project directory on the left, and open gradle-wrapper.properties. The software version I use is relatively low. If it is not in the same location as mine, you can find it yourself.

5. After opening, find the distributionUrl and delete the following address. In addition, here is the gradle version that its construction project matches. You can also go to the gradle download website to download the corresponding version according to this version.

 6. Modify the distributionUrl address to the absolute path where the gradle zip file has been downloaded locally. The format is as follows:

 7. If there is a jar package that needs to be imported, it can be configured in the build.gradle of the module. First, create a directory for placing the jar package, then configure it in the gradle configuration file, and configure compileOptions at the same time.

 Because it is placed under the app folder, there is no need to add the path

 Finally, pay attention to your own sdk version. If it is different, you can modify it in the dependency management section

The project construction is completed and can be developed normally.

 

 
 

 

Guess you like

Origin blog.csdn.net/m0_56326397/article/details/129346168