Android learning [Android kernel compilation process and error notes], android Kernel

Source: Internet
Author: User

Android learning [Android kernel compilation process and error notes], android Kernel

Blog: http://blog.csdn.net/muyang_ren
Ubuntu14.04 LTS (requires a 64-bit long-term support version of LTS)
Jdk1.8
Kernel: android4.0

I. jdk

1. Decompress jdk to obtain the path

2,
sudo vim /etc/environment
To:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/lhy/jdk/jdk1.8.0_45/bin"JAVA_HOME="/home/lhy/jdk/jdk1.8.0_45"CLASSPATH=".:/home/lhy/jdk/jdk1.8.0_45/lib"

3. source/etc/environment

Ii. ubuntu Configuration
Pay attention to the jdk version and the gcc and g ++ compiler versions,
Official Website configuration: http://source.android.com/source/initializing.html
Ubuntu14.04:

Sudo apt-get install bison g ++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev: i386 zip put all the following errors to be installed here sudo apt-get install g ++ sudo apt-get install gcc-multilibsudo apt-get install g ++-4.4-multilibsudo apt-get install flexsudo apt-get install libncurses5-devsudo apt-get install lib32ncurses5-devsudo apt-get install gawk (this is online to see the need to install, I will install it in advance and there will be no errors)

Error:

The following software packages have the following dependency: g ++-multilib: Dependency: gcc-multilib (>=4:4. 8.2-1ubuntu6) but it will not be installed with: g ++ (> =. 8.2-1ubuntu6) but it will not be installed E: the error cannot be corrected, because you require some software packages to maintain the status quo, that is, they destroy the dependency between software packages.

Solution:

sudo apt-get install g++sudo apt-get install gcc-multilib

Error:

Checking build tools versions... **************************************** * ****************** You are attempting to build with the incorrect versionof java. your version is: java version "1.8.0 _ 45 ". the correct version is: Java SE 1.6.Please follow the machine setup instructions at least. Mk: 131: *** stop. Stop.

Solution,

Use jdk 1.6 PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: /usr/games:/usr/local/games: /home/lhy/jdk/jdk1.6.0 _ 29/bin "JAVA_HOME ="/home/lhy/jdk/jdk1.6.0 _ 29 "CLASSPATH = ". :/home/lhy/jdk/jdk1.6.0 _ 29/lib"

Error:

G ++: selected multilib '32' not installedmake: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

Solution:

You need to install the multilib package of gcc and g ++, and directly execute the following command to automatically install the multilib package of g ++ and gcc; sudo apt-get install g ++-4.4-multilib

An error occurs (this can be ignored ):

Note: Some input files use or overwrite outdated APIs. Note: For details, use-Xlint: deprecation to re-compile. Note: Some input files use unchecked or insecure operations. Note: For details, use-Xlint: unchecked to recompile.

Solution (do not press the tab key for a long time if the machine is not good): make update-api

Error:

/bin/bash: flex: command not foundmake: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

Solution:

sudo apt-get install flex

Error:

Host C: adb <= system/core/adb/transport_usb.chost C: adb <= system/core/adb/commandline. chost C: adb <= system/core/adb/adb_client.chost C: adb <= system/core/adb/sockets. chost C: adb <= system/core/adb/services. chost C: adb <= system/core/adb/file_sync_client.chost C: adb <= system/core/adb/get_my_path_linux.chost C: adb <= system/core/adb/usb_linux.chost C: adb <= system/core/adb/utils. chost C: adb <= system/core/adb/usb_vendors.chost C: adb <= system/core/adb/fdevent. chost Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)/usr/bin/ld: cannot find-lncursescollect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

Solution:

sudo apt-get install libncurses5-dev

Error found:

/Usr/bin/ld: cannot find-lncursescollect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

Solution:

sudo apt-get install lib32ncurses5-dev

Error found:

Dalvik/vm/native/dalvik_system_Zygote.cpp: In function 'int setrlimitsFromArray (ArrayObject *) ': dalvik/vm/native/dalvik_system_Zygote.cpp: 194: error: aggregate 'rlimit rlim' has incomplete type and cannot be defineddalvik/vm/native/dalvik_system_Zygote.cpp: 217: error: 'setrlimit 'was not declared in this scopemake: * ** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1

Solution:

$ Vim dalvik/vm/native/dalvik_system_Zygote.cpp add header file # include <sys/resource. h>

The following can be ignored:
Note: Some input files use unchecked or insecure operations.
Note: to learn more, use-Xli

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.