Android source code compilation

Source: Internet
Author: User

Android source code compilation

After a long time, I finally downloaded the source code 4.4.2 (if you just want to know that the compilation process can be used as a ready-made solution). After the download, I started compiling.

My VM Ubuntu configuration source code is 16 GB + (. repo accounts for most of the items that can be deleted)

 

1. Go to the source code directory.

2 source build/envstup. sh

3 lunch (select the full-eng code or directly lunch full-eng)

4 make (my host configuration is usually used-j4 or-j8 will get stuck)

 

After you execute make, There will be various problems, mostly due to the lack of dependent files.

 

Next, when compiling to libwebviewchromium. so, it will take a long time for this file to have 1. Several GB of memory, which may cause insufficient memory.

Therefore, you can increase the virtual memory by setting swap files.

At the beginning, internal compling error still occurs after 1 GB.

3G is successfully set.

Dd if =/dev/zero of =/swapfile bs = 1024*3 count = 1024*1024

 

Sudo mkswap/swapfile
Sudo swapon/swapfile

 


The following command can be used to cancel compilation.

Sudo swapoff/swapfile
Sudo rm/swapfile
Use emulator to view the following results (you can directly use this command after 4.0)

If you want to continue using emulator after the interruption is disabled, you need

Source build/envsetup. sh

Lunch full-eng

Related Article

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.