<span id="Label3"></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">First of all, the compilation of Android used by the system, the current Ubuntu is a better platform, but also the official recommendation, but the specific version, said are relatively few, in order to avoid everyone detours, I say here, the best is Ubuntu 8.10, he has the various <span style="width: auto; height: auto; float: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">compilers</span></span> Is the most appropriate, Android compiler requirements for the compiler are almost Harsh. The internet always says 8.04 as a compiled system, but I say here that 8.04 is by no means the best system. I'll Show you the Following.</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Android compilation mainly includes to c,c++, the compilation, here is mainly gcc,g++,<span style="width: auto; height: auto; float: none;"><span style="width: auto; height: auto; float: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">compiler</span></span></span>, for the arm platform compiler, mainly arm-eabi-compiler, and Java compiler, is the jdk, the best version of gcc,g++ is 4.3 version, ubuntu 8.04 version of the GCC is 4.2.4, and through the Apt-get Install no gcc4.3 package, here depressed me for a long time, finally by downloading 8.10 of the package to complete the GCC upgrade, incidentally, ubuntu apt-get tool Source Add method, In/etc/apt/sourcelist is the source of the address, Here to add 8.10 version of the upgrade source, can be installed through the APT installation download 8.10 of the application, but because the upgrade in 8.04 can not reach GCC4.3, under normal circumstances, to different versions of the system software upgrade is not possible to use other versions of the software, so do not know what bad results, So choose the operating system is best 8.10, if it is 9 later version of the need to downgrade, is to install the lower version of the program, by modifying the soft link under/usr/bin, or apt-alternatives--config to choose, the link to the gcc, through the LN-SF gcc-4.3 gcc, modified, required for JDK via Apt-alternatives--config<span style="width: auto; height: auto; float: none;"><span style="width: auto; height: auto; float: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">Java</span></span></span>, Apt-alternatives--config javac,apt-alternatives--config javah, make changes, select JDK1.5 Version.</p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top:14px; margin-bottom:14px; Color:rgb (37, 37, 37); font-family: Microsoft ya hei, song body, sans-serif; font-size:16px; line-height:28px; white-space:normal; Background-color:rgb (255, 255, 255); "> First download Android source code, Android Source Control tool is using git, with repo to implement, install git,curl; /home/android/bin/repo, through repo init-u select Android code to download, here in the download, it is best to Use-b to select the download version, mainly because the default download is the Master branch is the version that is being written, upgrade, Plainly belongs to the beta version, to compile android, no benefit, preferably through-b to specify a stable version to download, B can be cupcake/eclair and so on, here need to be patient, general download 5, 6 can download finished, in my experience, Usually 6 o'clock in the morning to 10 o'clock in the morning about the speed is very good, other times speed Not. Network is often broken, through XXXX Modification. </p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top:14px; margin-bottom:14px; Color:rgb (37, 37, 37); font-family: Microsoft ya hei, song body, sans-serif; font-size:16px; line-height:28px; white-space:normal; Background-color:rgb (255, 255, 255); "> Next is the configuration of the build environment, compiling Android requires a lot of software, apt-get install Git-core gnupg sun- <span style="width:auto; height:auto; float:none;"><span style="color:rgb (0, 0, 255); width:auto; height:auto;">jav A </span> </span> 5-JDK Flex Bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Zip Curl Libncurses5-dev Zli b1g-dev, These are the official instructions needed, there may be fakeroot,apt-get install valgrind, anyway, It is important to ensure that the full installation of these tools, or compile will be a lot of inexplicable problems. </p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Then you can make it, first check the gcc,<span style="width: auto; height: auto; float: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">JDK</span></span> version is not the gcc-4.3,jdk1.5 version, and then modify the environment variables, export Java_home=/yourjdkpath/,android_java_ Home= $JAVA _home, Add these two sentences to/etc/environment, restart the machine, and enable the <span style="width: auto; height: auto; float: none;"><span style="color: rgb(0, 0, 255); width: auto; height: auto;">environment variable</span></span> .</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">[android] compile-time/usr/include/gnu/stubs.h:7: fatal error:gnu/stubs-32.h:no such file or directory error message</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"> <strong>missing LIBC Development package</strong> , installation: apt-get install libc6-dev-i386</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">[android]/usr/bin/ld:skipping Incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.5/appears at Compile Time. /.. /.. /libz.so When searching for-lz error message</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"> <strong>missing Lib32z1-dev</strong>, installation: apt-get install Lib32z1-dev</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Citation</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Host EXECUTABLE:ACP (out/host/linux-x86/obj/executables/acp_intermediates/acp)<br>/usr/bin/ld:skipping incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for-lstdc++<br>/usr/bin/ld:skipping INCOMPATIBLE/USR/LIB/GCC/X86_64-LINUX-GNU/4.4.3/LIBSTDC++.A when searching for-lstdc++<br>/usr/bin/ld:skipping incompatible/usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for-lstdc++<br>/usr/bin/ld:skipping INCOMPATIBLE/USR/LIB/GCC/X86_64-LINUX-GNU/4.4.3/LIBSTDC++.A when searching for-lstdc++</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Solve:</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">sudo apt-get install G++-multilib</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Gl/glx.h:no such file or Directory)</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">sudo apt-get install Libgl1-mesa-dev</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Then you can make, here to focus on the compiler may encounter errors, if you encounter errors found on the internet, it is possible to repo during the decompression of the file errors, will be in the Android src directory except the. repo directory, delete, re-execute repo Sync to unzip and Make. Other errors see this post, the basic problems are explained, add that in the duplicate entry problem, normal find is found 2, directly delete a good, but there are a few is find out 4, here need to look carefully, these 4 items in the two similar, Just a folder in the path is different, delete, delete the top-level directory of the different two one Can. Don't delete the Mistake.</p></p><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);"><p style="margin-top: 14px; margin-bottom: 14px; color: rgb(37, 37, 37); font-family: 微软雅黑, 宋体, sans-serif; font-size: 16px; line-height: 28px; white-space: normal; background-color: rgb(255, 255, 255);">Make once I on the virtual machine, single core to run, generally up to 3 hours or so need to wait patiently, if the compilation of errors, look at, after the solution, generally do not do clean, and then made the way, direct makes, generally can be from the wrong point to continue compiling, save Time.</p></p><p><p><br></p></p><p><p>Android source code compilation process details</p></p></span>
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