Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ 14.04.3 Ubuntu configuration and successfully compiled source code Android 6.0 r1     - Linux Firewall Builder shorewall (Linux)

- Ubuntu compiler installation R Full Record (Linux)

- C ++ free store and heap (Programming)

- MyCAT easy entry (Database)

- Ubuntu 15.04 / CentOS 7.0 to set custom boot (Linux)

- Talk about the Linux folder permissions issue again (Linux)

- How to install Ubuntu applications Device 7 (Linux)

- General Linux interface server parameter tuning (Server)

- Using Linux command line and execute PHP code (Programming)

- Lua4.0 interpreter documents (Programming)

- Ubuntu install VMware Workstation 11 tutorials at 14.04 / 14.10 (Linux)

- SolrCloud-5.2.1 cluster deployment and testing (Server)

- C / C ++ language variable scope: local variables, global variables, file-level variables (Programming)

- Yii2 Advanced Version Copy New Project Problem Solved (Programming)

- JEdit 5.2 Pro Edition installation on Ubuntu 14.04 (Linux)

- Prevent security threats caused Rootkit (Linux)

- Docker use Dockerfile created since the launch of the service support SSH container mirror (Server)

- How to modify the Sublime in Tab four spaces (Linux)

- Partition contrast manifestations under Windows and Linux (Linux)

- Inject script commands manually annotated summary (Linux)

  14.04.3 Ubuntu configuration and successfully compiled source code Android 6.0 r1
  Add Date : 2018-11-21      
  Finally succeeded in the Android 6.0 r1 source source compiler. First on the map, which is running in Ubuntu Android emulator:

Since I installed VMware virtual machine in Win8, and then compile install Ubuntu in a virtual machine, I encountered a lot of trouble. If they are directly compiled in Linux, it may be more successful.

Recommendation: ubuntu memory allocation 4G, 90G reserved virtual hard disk (before you choose the default 20G, directly reported to insufficient space in extracting tgz time), network selection "Bridged" mode.

To compile the Android source code, for the following installed ubuntu make some configuration.

First, bring up the terminal, use the following shortcuts

Ctrl + Alt + T
1, install Git and other dependent components

sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev: i386 libx11-dev: i386 libreadline6-dev: i386 libgl1-mesa-dev g ++ - multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev: i386 dpkg-dev libsdl-dev libesd0-dev
The above is the red part of the number "1." Of course, you can also execute these commands installed separately.

If you do not rely on these components, you may encounter an error like this:

2, the installation JDK

First search JDK version with the following command

apt-cache search openjdk

The installation

sudo apt-get install openjdk-7-jdk
Check whether the installation is successful

java -version

3, the configuration java_home

Directly run

echo $ JAVA_HOME
And can not see the output.


echo export JAVA_HOME = "/ usr / lib / jvm / java-7-openjdk-amd64 /" >> ~ / .bashrc
Then restart the terminal or by using the following command

source ~ / .bashrc
In this case re-enter the $ JAVA_HOME, you can see the path configured

4, install SSH Server

What is the use of it? Use Xshell help us operate the virtual machine windows and files. Ubuntu by default is not installed SSH Server, Client touches us fitted.

sudo apt-get install openssh-server
Restart it

sudo /etc/init.d/ssh restart

5, copy Android source code to Ubuntu

This way stupid point. Use Xshell actually quite fast. Direct drag in.

6, merge files

 Monitoring File Hash, to see if there is damage. What specific correspondence control string please hash.txt

md5sum Android6_r1_aa
Then these merge several files into one

cat Android6_r1_ *> M.tgz
Calculate the combined file hash

md5sum M.tgz

7, unzip the file

tar zxvf M.tgz
 This is a long process.

 This command creates mydroid decompression folder, extract the stuff in it

8, before compiling configuration

In .bashrc file, add: export USE_CCACHE = 1, as follows:

echo export USE_CCACE = 1 >> ~ / .bashrc
In order to improve the efficiency of the compiler, set the compiler cache. Execute the following command:

prebuilts / misc / linux-x86 / ccache / ccache -M 30G
-M 30G 30G set two parameters indicate the size of the space as a cache, this value can continue to adjust according to the size of your hard drive space

Then import the Android source code compiler required environment variables and other parameters, run the following command

source build / envsetup.sh

Select Run command lunch compiled object


For example, select 1, you receive the following message, telling us to compile source code of some relevant information

9, compilation

make -j8
Because the notebook is i5 4210u, so the use of 8 (CPU core twice), where it may be set too big.

10, continue to compile (error continues, frustration)

Opinion was not always smooth, ah, a problem. I thought JDK version does not enter the build / core / main.mk

We find that the default is 1.7.

Stop error in the following places:

The above mentioned, at the beginning I did not install these dependent components, resulting in unnecessary trouble.

Continues compilation

make -k
After use make -k, on the tragedy, I compiled a night not good.

Up in the morning when the decisive use "Ctrl + C" Interrupting Compilation, reinstall the above dependencies, then do cleanup work

make clean
Then continue to start, more months sudo, because before the compiler output similar prompt "no permission to operate."

sudo make -j8
 About two hours later, 100% disk usage, had not changed. Compile it seems stopped. An hour later, seemingly hanging T ~ T

Is cache take up too much disk space? Not enough space for the virtual machine?

Well, I re-installed a Ubuntu. Then assign 60G virtual space, 2G memory, 20G compiler cache. He ran a night.

The next day saw another error, really tears!
arm-linux-androideabi-g ++: Internal compiler error: Killed (program cc1plus)
What is a ghost?

Command build-essential, g ++ I also installed it.

google a bit, there is a bug report: Build # 478 Failed, but did not see the answer.

Stackoverflow see a similar Q: arm-linux-androideabi-gcc: Internal error: Killed (program cc1) from Android NDK r8

Finishing few answers:

This error went away for me when I used "make" instead of the recommended "make -j4".
But rebooting the virtual machine seems to fix the problem for me. // Are you sure ??
For those having this issue with VMs, the solution that worked for me was bumping up the base memory. It was originally set to 512MB to 1536MB.
But this is gcc Yeah.

Then find this: firefox build for Android fails, which referred to:

well the problem was caused by too little RAM allocated to my VM. Upped the RAM from 1Gb to 4Gb and the compile is now proceeding nicely.
RAM is really small?

Try it again. Since the machine configuration reason, it seems only a maximum allocation of 3G memory to the virtual machine. And then directly execute the command sudo make.

Crazy ah! ! Is ARM also smaller?

Reinstall ubuntu again. The allocation of 90G hard disk space, 4G memory (I thought only to 3G).

11, compiled successfully

Use the following command to compile the final

sudo make -j2
Execution begins around 11:30, 22:00 back to see actually compiled a success! System.img you not see? Haha ~

Into the directory / out / target / product / generic, you can see ramdisk.img, system.img, userdata.img, cache.img four image files

12, run Android Emulator

Just because the compilation is successful, if not exited the terminal at this time, you can directly enable the command to run the Android emulator.


If you exit the terminal previously compiled command line window, then run the simulator is completely different.
- OpenSUSE 13.1 OpenSUSE 12.3 and how to install Cinnamon 2.2 Desktop (Linux)
- GRUB and Linux system repair (Linux)
- Preps - Print within the specified range of IP addresses (Linux)
- rpm package specify the installation path (Linux)
- TOAST function in PostgreSQL (Database)
- Ubuntu treated with cue file to ape and wav files automatically track points (Linux)
- Elaborate .NET Multithreading: Thread Pool (Programming)
- CentOS 6.4 Python 2.6 upgrade to 2.7 (Linux)
- Linux performance optimization features Tuned and ktune (Linux)
- Oracle archive log full cause abnormal slow database performance (Database)
- Oracle 11g users to create, authorize and import dmp file (Database)
- Applications in Objective-C runtime mechanism (Programming)
- Use Ambari rapid deployment Hadoop big data environment (Server)
- NAT (network address translation) Realization (Linux)
- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)
- Analysis of Java reflection mechanism (Programming)
- Alternative methods of intrusion bundled executable file new thinking (Linux)
- CentOS boot image to achieve semi-automatic installation (Linux)
- Linux crontab (Linux)
- Linux Systemd-- To start / stop / restart services in RHEL / CentOS 7 (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.