Visualbox ubuntu14.04 64-bit android4.4.4 Source compilation summary

Source: Internet
Author: User

Toss for several days, today finally compiled through, with 4 hours, too difficult. As shown in the following:

Software Environment

Virtual machine: Visualbox

Operating system: Ubuntu14.04 64-bit

Android Source: Android-4.4.4_r1

In this process encountered a variety of problems, through the Apt-get install the corresponding library can be resolved part. Compile 2-3 hours of time to encounter a tricky problem,

"Make: * * * * [out/target/product/mako/obj/shared_libraries/libwebviewchromium_intermediates/linked/ Libwebviewchromium.so] Error 1 "

Neither Google nor Baidu has found a solution. See the user successfully compiled android4.4 source of the article, the steps mentioned in their own operation, and finally can be compiled successfully, the following list of their own steps to operate:

1. If you are using a virtual machine, be sure to keep the size of the virtual machine above 100G

2. Download and install Jdk6
Note that the version must be JDK6 and the other versions will be problematic.
The methods of online circulation are mostly Apt-get install JDK installed, the actual operation proves that this is not possible, the following gives a download jdk6 address
Https://jdk6.java.net/download.html is here to choose the self-extracting file (self-extracting) according to the configuration of his machine.
Download the above to get the Jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin file, change the property to have executable permission.
The./jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin can be installed, the JDK is 32-bit.

3. Vim ~/.BASHRC added at the end

Path= $PATH:/usr/local/java/jdk1.6.0_38/bin
classpath=.:/ Usr/local/java/jdk1.6.0_38/lib
Java_home=/usr/local/java/jdk1.6.0_38

Then execute the source ~/.BASHRC to make the configuration effective

4. Set the default JDK under Ubuntu
Because Ubnuntu has the default installation of OPENJDK, but we compile the Android source code is required jdk6, so you need to set the default to Jdk6
sudo update-alternatives--install/usr/bin/java Java/usr/local/java/jdk1.6.0_38/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/local/java/jdk1.6.0_38/bin/javac 300
Update-alternatives--config Java

5. Test that the JDK environment variable is configured correctly

vbox:~$ java-version
Java Version "1.6.0_38-ea"
Java (TM) SE Runtime Environment (build 1.6.0_38-ea-b04)
Java HotSpot (TM) Server VM (build 20.13-b02, Mixed mode)

If the above information is present, the JDK environment variable has been configured successfully

6. Additional software to be installed in advance
Description, in order to ensure that the compilation process is not always missing some software and interrupted, so must be prepared to do, do not fight any unprepared war.
Many of the online predecessors have been given a lot of software to install in advance, the following to concentrate them out.

sudo apt-get install build-essential make gcc g++ libc6-dev patch \
Texinfo Libncurses-dev Flex Bison git-core gperf Libsdl-dev libesd0-dev \
Libwxgtk2.6-dev build-essential Zip Curl Ncurses-dev Zlib1g-dev Valgrind

Above this command, I did not execute, installed a few of the packages mentioned below.

sudo apt-get install libgtk2.0-0:i386
sudo apt-get install libpangox-1.0-0:i386
sudo apt-get install libpangoxft-1.0-0:i386
sudo apt-get install libidn11:i386
sudo apt-get install gstreamer0.10-pulseaudio:i386
sudo apt-get install gstreamer0.10-plugins-base:i386
sudo apt-get install gstreamer0.10-plugins-good:i386
sudo apt-get install gstreamer0.10-ffmpeg:i386 (the software I did not install successfully, and finally did not have any problems)

Add a note: The last few of the softwares above are i386 because of a bug (which is not really remembered at the moment), and the reason for the error is that you need to install the Ia32-libs package 64-bit Linux (Ubuntu) When compiling Android source code also need a 32-bit Linux package, so need this ia32-libs support package, but this ia32-libs package is not found on the Internet, nor found the actual solution available, but from the Ubuntu official website, This ia32-libs is actually a collection of several packages, so download and install a few of the packages can achieve our goal.

7. In order to improve the efficiency of the compilation, we'd better set the compiler cache to speed up the compilation speed, use the following command

Prebuilts/misc/linux-x86/ccache/ccache-m 50G

Precautions:

① premise is already added in the. bashrc file: Export Use_ccache = 1

②ccache is an executable file

③-m 50G two parameters to set the 50G size of the space as a cache, this value can be adjusted according to their own time hard disk space size

CCache is a compiler ccache for C and C + +. can make building faster.

You can use the following actions to see the size of the CCache used:

$watch-n1-d Prebuilts/misc/linux-x86/ccache/ccache-s

If you use an ice Cream Sandwich (4.0.x) or older version, you need to use prebuilts instead of Prebuilts/misc

8. Formally compiling Android source code
Having done so much preparation, I can finally do the work now. According to the Android website, compiled Android source code to execute the following three commands can be
①source build/envsetup.sh
②lunch to select a compilation platform at this time
After you run the lunch command to select a compile target, the following message appears, telling us about the compiled source code


③make-jn
Here the n attention to the value, the Internet is generally said to be twice times the number of CPU cores, there is a CPU core number plus 1. I didn't verify which one was more accurate.
However, it is worth reminding that, although N uses a large value to make the compilation faster, if n is too large, the compilation will be an error.
If you are not sure what value n should use, then use the Make command directly.

After the compilation is completed in the source directory out/target/product/generic/generated corresponding firmware and other files, as shown, we can run the simulator or brush machine.

The Out/target/generic directory contains the final target file to be used.
The Out/target/generic/system directory is the directory after system.img decompression. Most of the programs in the Android system are in the system directory, including the APK application (Out/target/generic/system/app).

The Out/target/generic/root directory is the directory after ramdisk.img decompression.

The Out/target/generic/data directory is the directory after userdata.img decompression.

Visualbox ubuntu14.04 64-bit android4.4.4 Source compilation summary

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.