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