Complete Android development environment to build
git configuration
Download and install git
git official website download
Direct Baidu download, and then install (remember the installation directory).Configure the git environment
Find the cmd folder in the installation directory (D:\work\Git\cmd);
configure it in the environment variable path;
enter git –version in cmd to display the git version number and the configuration is successful.git configure user
Configure user information
git config –global user.name “xxxx”
git config –global user.email xxxx.comGenerate ssh key
right click, git gui, help->show ssh key to generate ssh key, enter the password twice to generate ssh keyConfigure the ssh key
to enter the company's git website, find the ssh key in the settings, copy the key in, enter the title, and click addkey.git clone project cmd git clone xxxxx (project address).
JDK configuration
Download and install JDK;
Configure JDK environment variables;
- Create a new system environment variable JAVA_HOME, whose address is the JDK installation root directory D:\work\jdk.
- Join in path% JAVA_HOME% \ bin;% JAVA_HOME% \ jre \ bin
- Create a new system environment variable CLASSPATH, the address is %JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
- cmd java or java -version displays the information that the configuration is successful.
maven configuration (required by the company, you can skip this process)
- Copy the file Apache-Maven-3.2.1 to the working directory;
- Create a new local maven repository directory Maven_Repository folder;
- Modify and modify the D:\work\Apache-Maven-3.2.1\conf\settings text warehouse address D:/work/Maven_Repository;
- Configure maven environment variables:
- Create a new M2_HOME system environment variable D:\work\Apache-Maven-3.2.1
- Add %M2_HOME%\bin to path
- Open cmd, enter mvn -version, display version information, the configuration is successful
Android Studio configuration
- Download Android Studio download address
Install AndroidStudio Androidstudio First installation (quoted from: Life One article: Everything you should know when using Android Studio for the first timeWhen there
is such a problem, the project generally has this problem because gradle-3.3-all.zip is used, and gradle-3.3-all.zip cannot be downloaded directly in studio.
There are several solutions to this problem:
- You can modify the version of gradle in gradle-wrapper.properties, which is consistent with the version of gradle that did not report an error before, and then modify the version number of com.android.tools.build:gradle in the project build.gradle file, which is exactly how much Refer to the previous projects that did not report errors.
- Find gradle-3.3-all.zip directly on the Internet and download it, do not unzip it, put it in a directory similar to the following C:\Users\Administrator.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9, this method has not been tried Yes, it is logically possible. The download address is here: http://services.gradle.org/distributions/ , there are various versions in it.
- The easiest way, and the way I use it, is to change the distributionUrl in gradle-wrapper.properties
towhen it appears
- If you are running 32-bit android studio, you need to modify the file:
in the startup directory of android studio. Find the file studio.exe.vmoptions. Add
-Djava.net.preferIPv4Stack=true
-Didea.updates.url= http://dl.google.com/android/studio/patches/updates.xml
-Didea.patches.url= http://dl .google.com/android/studio/patches/- If it is 64-bit, find the file studio64.exe.vmoptions and add
-Djava.net.preferIPv4Stack=true
-Didea.updates.url= http://dl.google.com/android/studio/patches/ updates.xmlConfigure the Android environment:
- git file->setting Search for git, check whether the address of the path to git executable column is correct, and then Test
- Configure the android environment to use commands such as
adb
%\platform-tools- Configure the GRADLE_HOME system environment variable
1. Configure the GRADLE_HOME environment variable D:\AndroidStudio\gradle\gradle-3.5-all\exhrs6ca08n232b14ue48lbye\gradle-3.5
2. Add %GRADLE_HOME%\bin
to the path 3. Enter gradle -v in the cmd and gradle appears version, okWhen ADB cannot be used, check whether the environment variables of ADB are configured successfully. The general directory is the directory of the SDK to platform-tools;