Android source download and compilation process

Source: Internet
Author: User

This is the compilation steps and error resolution that I compiled when compiling the Android source code, during which I consulted some online blogs and tutorials.

The first step:

Install ubuntu12.04, allocate a disk of space 50g,2g memory. If you allocate 1G memory compilation, an error will be encountered. (I installed Ubuntu in the virtual machine, allocated 50G space, compiling the source code needs a large space, it is recommended to allocate 50G or more, using Wubi installation can only allocate 30G).

Step Two:

Install JDK, the JDK version is jdk6-6u29 32-bit, download link http://www.oracle.com/technetwork/java/javase/downloads/ Java-archive-downloads-javase6-419409.html. Download Jdk-6u29-linux-i586.bin.

1. Execute sudo su command in terminal to enter password into root user.

2, the execution of the file Jdk-6u29-linux-i586.bin copy to the/usr/lib/jvm/java directory, (if the directory does not exist to establish the directory, the establishment of the command is Mkdir/usr/lib/jvm/java).

3. Execute the command./jdk-6u29-linux-i586.bin Execute the file

4. Modify environment variables add the following lines at the end of the/etc/profile file:

5, the implementation of the Source/etc/profile order to make it effective.

6, the implementation of Java–version

Java version 1.6.0_29 appears. Ensure that the current JDK version is 1.6.0

Note: The difference of environment Profile BASHRC in/etc directory is detailed below:

http://blog.csdn.net/chenchong08/article/details/7833242.

7 , install the packages required for compilation.

Perform apt-get install Git-core GnuPG Flex Bison gperf build-essential

Apt-get Install Zip curl Libc6-dev libncurses5-dev:i386 X11proto-core-dev

Apt-get Install Libglapi-mesa-dev

Apt-get Install libx11-dev:i386

Apt-get Install libreadline6-dev:i386

Apt-get Install libgl1-mesa-glx:i386

Apt-get Install Libgl1-mesa-dev

Apt-get Install G++-multilib Mingw32

Apt-get Install Tofrodos

Apt-get Install Python-markdown

Apt-get Install Libxml2-utils

Apt-get Install Xsltproc

Apt-get Install zlib1g-dev:i386

8 , installation Repo

Execute the following command

Apt-get Install Curl

Apt-get Install git

Create an Android folder in the/HOME/PC directory to save Android source code and repo

Execute the following command:

mkdir/home/pc/android/android4.0 Save the source under Android

Add the following code at the end of the/etc/profile/

Export path= $PATH:/home/pc/android

Source/etc/profile

Execute the following command:

Cd/home/pc/android

Download repo and Modify permissions

Curl http://git-repo.googlecode.com/files/repo-1.13 >/home/pc/android/repo

chmod a+x Repo

9 , download Android Source Code

Repo Init-u https://android.googlesource.com/platform/manifest

You need to enter your user name and mailbox during the execution process

Execute command:

Repo Init-u https://android.googlesource.com/platform/manifest-b ANDROID-4.0.4_R1

(Note: Android version reference: Https://android.googlesource.com/platform/manifest/+refs)

Execute command:

Repo Sync

Ten , compiling the source code

Enter the source directory to execute the following command:

Make showcommands so that you can display the compilation command, so that when the compilation, the screen does not output when the time, do not feel bored?

Errors encountered and how to resolve them:

ERROR:/bin/bash:line 2:javadoc:command not found

Workaround: Execute: Ln-s-f/usr/lib/jvm/java/jdk1.6.0_29/bin/javadoc/bin/javadoc

By the way, you can make a soft connection, or you will encounter a similar error:

Ln-s-f/usr/lib/jvm/java/jdk1.6.0_29/bin/jar/bin/jar

Ln-s-f/usr/lib/jvm/java/jdk1.6.0_29/bin/java/bin/java

Ln-s-f/usr/lib/jvm/java/jdk1.6.0_29/bin/javah/bin/javah

Ln-s-f/usr/lib/jvm/java/jdk1.6.0_29/bin/javac/bin/javac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.