Summary on setting up an android compiling environment in Ubuntu

Source: Internet
Author: User

Android source code: officially downloaded
Android compiled version: platform_version = 4.2.2
OS Operating System Platform: Linux Carson-PC 3.0.0-12-generic # 20-ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux (ubuntu11.04 64bit)

1. jdk1.6 is used, and jdk1.7 is not used.

2./bin/Bash: bison: Command not found

Method: sudo apt-Get install bison

3./bin/Bash: effectproc: Command not found

Method: sudo apt-Get install strongtproc

4./bin/Bash: Flex: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_l.cpp] Error 127

Method: sudo apt-Get install flex

5. sh: gperf: not found
Calling gperf failed: 32512 at./makeprop. pl line 140.

Method: sudo apt-Get install gperf

6. GCC: Error trying to Exec 'cc1plus ': execvp: no such file or directory

Method: sudo apt-Get install g ++

7. collect2: Error: LD terminated with signal 9

Method: Increase the virtual memory of ubuntu. The procedure is as follows:

Setp1: view the system virtual memory. Command: Free-m

 

carson@carson-pc:~$ free -m             total       used       free     shared    buffers     cachedMem:          1998       1528        469          0          6        423-/+ buffers/cache:       1098        900Swap:         2036        361       1675

I have added swap. Generally, swap2 G is enough for Android compiling. During the compilation process, although 2 GB is added, this problem also occurs if some operations take up swap. For example, copy the android source code from a mobile hard disk.

 

Setp2. create a swap file.

Mkdir swap
CD swap
Sudo dd If =/dev/Zero of = swapfile BS = 1024 COUNT = 100000
The following message is displayed. The count in the preceding command indicates the swap file size, that is, the increased virtual memory size. This command displays the following information:

 

100000+0 records in100000+0 records out102400000 bytes (102 MB) copied, 0.377325 s, 271 MB/s

Setp3: Convert the generated file to a swap file
Sudo mkswap swapfile

 

This command displays the following information:

 

Setting up swapspace version 1, size = 99996 KiBno label, UUID=b26fe88c-11c2-40ad-8139-6e69e96b6b68

Setp4: Activate the swap file.
Sudo Swapon swapfile

 

Free-m to view swap information

 

             total       used       free     shared    buffers     cachedMem:          1998       1189        809          0         34        624
-/+ buffers/cache:        530       1468Swap:         2134        986       1148

Now, swap has been added successfully. If you want to uninstall the newly added swap;

 

Sudo swapoff swapfile

If you need to keep this swap, you can change Sudo-s to root.
Write it to the/etc/fstab file.

Swapfilepath swap ults 0 0

8. In file encoded ded from/usr/include/semaphore. h: 22: 0,
From CTS/suite/audio_quality/lib/include/semaphore. h: 21,
From CTS/suite/audio_quality/lib/src/semaphore. cpp: 17:
/Usr/include/features. h: 323: 26: Fatal error: bits/predefs. h: no such file or directory
Compilation terminated.
Make: In file included from/usr/include/stdlib. h: 25: 0,
From CTS/suite/audio_quality/lib/src/ADB. cpp: 16:
/Usr/include/features. h: 323: 26: Fatal error: bits/predefs. h: no such file or directory
Compilation terminated.

Method: sudo apt-Get install libc6-dev: i386

Sudo apt-Get install build-essential

Sudo apt-Get install gcc-multilib

9./bin/sh: GCC: not found

Method: sudo apt-Get install GCC. GCC is the C compiler.

10. gccgcc: Error trying to Exec 'cc1plus ': execvp: GCC: Error trying to Exec 'no such file or directory

Method: sudo apt-Get install g ++, G ++ is the c ++ Compiler

11./bin/Bash: xmllint: Command not found
Method: sudo apt-Get install libxml2-utils

To be continued

 

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.