Android4.1.1 system compilation process

Source: Internet
Author: User
I. compilation environment: first introduce the tool used in Compilation: Virtual Machine: vmare 9: ipv12.04 64-bit JDK: sun-java6-jdk (64-bit) cross compilation tool chain: GCC version is: 4.6.3 to complete the final compilation, of course, the first thing to do is check the environment: 1. Set the space size of the installed Ubuntu: at least 30 GB. Currently, the downloaded package has 10 Gb. The following figure shows the truth: including decompressing and compiling the package with a size of 30 GB: the space must be enough. 2. GCC and G ++ cannot use version 4.4 (Android 4.4 is used for compiling the Android system). Now we only need to use the 4.6.3 (ubuntu12.04) that comes with the system. 3, JDK version: sun-java6-jdk Ii. Compilation:The compilation process is unknown. You can view the official documentation. 1. Source build/envsetup. sh: Import different vendor versions to the system and add the M command. 2. Select the compiling vendor version for lunch. 3. Check the figure to compile the MM version. Of course, the lunch full-Eng here is all compiled. If it is too slow, compile one separately. Then mm can be compiled (the MM command is available only when source is required, and only valid at Terminal) Iii. compilation errors:There are too many errors and some summary is made. If an error occurs during compilation, you can check:/bin/Bash: bison: Command not foundmake: * ** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp] Error 127 solution: sudo apt-Get install bisonmake: * ** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_l.cpp] Error 127 solution: sudo apt-Get install flexmake: * ** [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/WebCore/CSS/csspropertynames. h] Error 25 solution: sudo apt-Get install gperf/usr/include/features. h: 324: 26: Fatal error: bits/predefs. h: No such file or directoryin file stored ded from/home/hudan/Android/source/android4.1.1/prebuilts/GCC/linux-x86/host/i686-linux-glibc2.7-4.6/bin /.. /sysroot/usr/include/sys/types. h: 27: 0, from frameworks/native/include/utils/errors. h: 20, from frameworks/native/include/utils/string8.h: 20, from CTS/suite/audio_quality/lib/include/settings. h: 21, from CTS/suite/audio_quality/lib/src/settings. CPP: 17:/usr/include/features. h: 324: 26: Fatal error: bits/predefs. h: No such file or directoryin file stored ded from/usr/include/stdlib. h: 25: 0, from CTS/suite/audio_quality/lib/src/ADB. CPP: 16:/usr/include/features. h: 324: 26: Fatal error: bits/predefs. h: No such file or directorycompilation terminated. compilation terminated. compilation terminated. make: *** [out/host/linux-x86/obj/static_libraries/libcts_audio_quality_intermediates/src/simplescriptexec. o] Error 1 make: *** waiting for unfinished jobs .... make: *** [out/host/linux-x86/obj/static_libraries/libcts_audio_quality_intermediates/src/ADB. o] Error 1 make: *** [out/host/linux-x86/obj/static_libraries/libcts_audio_quality_intermediates/src/settings. o] Error 1In file included 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: 324: 26: Fatal error: bits/predefs. h: No such file or directorycompilation terminated. make: *** [out/host/linux-x86/obj/static_libraries/libcts_audio_quality_intermediates/src/semaphore. o] Error solution: sudo apt-Get install gcc-multilib

Error libgl. So: cannot open shared object file: no such file or directory

OSError: libGL.so: cannot open shared object file: No such file or directory

May appear on Linux systems when you try to launch vnl for the first time. To solve it, create (as Administrator) a new link in/usr/lib:

sudo ln -s /usr/lib/libGL.so.1.2 /usr/lib/libGL.so
 

If you have a 64-bit Linux, use/usr/lib64 instead.

First check that you actually have "libgl. so.1.2 "in/usr/lib or/usr/lib64; it might be called" libgl. so.1 "or something else instead, or located in another directory, depending on the video drivers. you can use

locate libGL

To find the correct file to link.

I am using Ubuntu 12.04 bit-64, and there is no libgl. So file in/usr/lib.

You can use locate libgl to find this file. Result:

Find out so much, of course, it is to select libgl under the 64-bit platform.

However, I don't know which one to choose.

Failed to load libgl. So

Error libgl. So: wrong Elf class: elfclass64

The Linux system is 64-bit. This command does not support 64-bit

The best solution is to set the oralce-lib environment variable to lib32.

Finally, 36 bits are selected for ln.

Code: hudan @ Ubuntu :~ /Android/sources/android4.1.1/out $ sudo ln-S/usr/lib/i386-linux-gnu/MESA/libgl. so.1.2/usr/lib/libgl. So

Run the compiled system. IMG and the following error occurs:

The direct parameter-ramdisk. IMG is removed, and the simulator runs, but the kernel cannot be started.

No Abi error, when creating an android Virtual Device

 

E: cocould not get lock/var/lib/dpkg/lock-open (11: Resource temporarily unavailable)

E: Unable to lock the Administration Directory (/var/lib/dpkg/), is another process using it?

Solution: sudo RM/var/lib/APT/lists/lock

SH: gperf: not found

Target generated: libwebcore <= external/WebKit/source/javascriptcore/create_regex_tables
Generating csspropertynames. H <= csspropertynames. In
SH: gperf: not found
Calling gperf failed: 32512 at./makeprop. pl line 140.
Make: *** [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/WebCore/CSS/csspropertynames. H] Error 25
Make: *** deleting file 'out/target/product/generic/obj/static_libraries/libwebcore_intermediates/source/WebCore/CSS/csspropertynames. H'

Solution: sudo apt-Get install gperf

N file encoded ded from/usr/include/stdlib. h: 25,
                From build/tools/ACP. C: 11:
/Usr/include/features. h: 323: Fatal error: bits/predefs. H: No file or directory compilation interruption.
Make: *** [out/host/linux-x86/obj/executables/acp_intermediates/ACP. O] Error 1

Make: *** [out/host/linux-86/obj/static_libraries/libcts_audio_quality_intermediates/src/ADB. O] Error 1

Installation: libc6-dev-i386
    Sudo apt-Get install libc6-dev-i386


Make: *** [out/target/product/generic/obj/shared_libraries/libwebcore_intermediates/linked/libwebcore. So] Error 1

Make: *** waiting for unfinished jobs ....

Make: *** [out/target/common/obj/apps/Android. Core. Tests. libcore. Package. Dalvik. no-core-tests-res_intermediates/noproguard. classes-with-local.dex] Error 130

The last time make or MMM was used to generate something wrong.

You can use: Make clean and then make again

Solution: Rm out/target/common/obj/apps/-R (if such an error persists, you can only clean it)

4. Run the compiled system VI/etc/profile and add the following three statements to run the configuration. I will show you the figure: you only need to complete the three statements, if the source/etc/profile has a black screen, we recommend that you restart it. Next, when running: emulator runs perfectly:

The following are the problems encountered: After compiling the system, run the system in the simulator. You only need to configure the system before 2.3: export android_product_out =/home/hudan/Android/source/android4.1.1/out/target/product/generic_x86export Path = $ path: /home/hudan/Android/source/android4.1.1/out/host/linux-x86/bin, but the following error always occurs: emulator: Error: you did not specify a virtual device name, And the systemdirectory cocould not be found. if you are an android SDK user, please use '@ <Name>' or '-AVD < Name> 'to start a given virtual device (see-help-AVD for details ). otherwise, follow the instructions in-help-disk-images to start the emulator. This is the problem that emulator cannot run directly under adnroid4.1.1. refer: http://blog.csdn.net/dongminghao888/article/details/7860884latest configuration export android_build_top =/home/hudan/Android/source/android4.1.1 everything is OK. If it is the study of the android source code welcome group exchange: Android system high-level exchange group: 247039470 reprint Please attach the original address: http://blog.csdn.net/hudan2714/article/details/7926924

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.