Android development environment build

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

  1. Configure user information
    git config –global user.name “xxxx”
    git config –global user.email xxxx.com

  2. Generate ssh key
    right click, git gui, help->show ssh key to generate ssh key, enter the password twice to generate ssh key

  3. Configure 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.

  4. git clone project cmd git clone xxxxx (project address).

JDK configuration

  • Download and install JDK;

  • Configure JDK environment variables;

  1. Create a new system environment variable JAVA_HOME, whose address is the JDK installation root directory D:\work\jdk.
  2. Join in path% JAVA_HOME% \ bin;% JAVA_HOME% \ jre \ bin
  3. Create a new system environment variable CLASSPATH, the address is %JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
  4. 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:
  1. Create a new M2_HOME system environment variable D:\work\Apache-Maven-3.2.1
  2. Add %M2_HOME%\bin to path
  3. Open cmd, enter mvn -version, display version information, the configuration is successful

Android Studio configuration

  1. 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 time
  2. When there write picture description here
    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:

    1. 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.
    2. 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.
    3. The easiest way, and the way I use it, is to change the distributionUrl in gradle-wrapper.properties
      to
  3. when it appears
    write picture description here

    1. 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/
    2. 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.xml
  4. Configure the Android environment:

    1. git file->setting Search for git, check whether the address of the path to git executable column is correct, and then Test
    2. Configure the android environment to use commands such as
      adb
      %\platform-tools
    3. 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, ok
  5. When 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;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326614664&siteId=291194637