Android source code error handling

Source: Internet
Author: User

1. Install Ubuntu 10.10
You can choose to use wubi for installation.

2. Install Python
Ubuntu 10.10 has been installed with version 2.6.

3. Install JDK
Update the software library:
Sudo add-Apt-repository "Deb http://archive.canonical.com/lucid partner"
Sudo apt-Get update
Download JDK:
Download the sun-java6-jdk or execute the command: sudo apt-Get install sun-java6-jdk using the new software package manager
Modify the current JDK version: sudo Update-alternatives -- config Java

4. install required components
To set up your development environment, install the following required packages:
Run the command: sudo apt-Get install Git-core GnuPG flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev

For building froyo or an older release on a 64-bit system, several other packages are necessary to establish a 32-bit Build Environment:
Run the command: sudo apt-Get install gcc-multilib g ++-multilib libc6-i386 libc6-dev-i386

5. install required Libraries
Go to the new software package manager, check the lib32z1-dev, zlib-bin, and install.

6. Install MTD-utils (ProgramCannot upgrade, use the specified version of mtd-utils_20090606-1_amd64.deb)
Force installation: sudo dpkg-I file name
This component is used to create an ubi file system.

7. Install the GCC compiler
Version 4.4.5 has been installed by default.

8. Install the cross-compilation tool arm-Linux-GCC (the default Pao configuration is that the source code is placed under the project in the main folder, and the arm-Linux-GCC is placed under the tools of the project)
A. Extract the arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz and execute the command:
Tar xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz-C home/Administrator/project/tools/
CP-r home/Administrator/project/tools/opt/friendlyarm/toolschain/4.5.1/home/Administrator/project/tools/arm-linux-4.5.1/
Rm-RF home/Administrator/project/tools/OPT
B. Set environment variables (use ":" To separate multiple variables ):
Sudo gedit/etc/profile
Add: Path = $ path:/home/Administrator/project/tools/arm-linux-4.5.1/bin at the end
C. Log On again and run: Arm-Linux-GCC -- V to test whether the installation is successful.

9. handle errors
When ubuntu10.10 (64-bit) is used to compile the android2.3 source code, various problems are encountered. Either missing or missing. These problems and solutions are listed for your reference.

Error:
/Usr/include/GNU/stubs. h: 7: 27: Error: GNU/stubs-32.h: no such file or directory
Make: *** [out/host/linux-x86/obj/executables/acp_intermediates/ACP. O] Error 1

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

Error:
Make: *** [out/host/linux-x86/obj/executables/acp_intermediates/ACP] Error 1

Solution:
Sudo apt-Get install g ++-multilib

Error:
External/clearsilver/cgi. C: 22: Fatal error: zlib. h: no such file or directory
Compilation terminated.
Make: *** [out/host/linux-x86/obj/shared_libraries/libneo_cgi_intermediates/cgi. O] Error 1

Solution:
Sudo apt-Get install zlib1g-dev

Error:
/Usr/bin/ld: cannot find-LZ
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/aapt_intermediates/aapt] Error 1

Solution:
Sudo apt-Get install lib32z1-dev

Error:
Bison-D-O out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
/Bin/Bash: bison: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp] Error 127

Solution:
Sudo apt-Get install bison

Error:
LEX: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
/Bin/Bash: Flex: Command not found
Make: *** [out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_l.cpp] Error 127

Solution:
Sudo apt-Get install flex

Error:
/Usr/bin/ld: cannot find-lncurses
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/executables/adb_intermediates/ADB] Error 1

Solution:
Sudo apt-Get install lib32ncurses5-dev

Error:
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 55: Fatal error: X11/xlib. h: no such file or directory
Compilation terminated.
Make: *** [out/host/linux-x86/obj/executables/emulator_intermediates/Android/main-common.o] Error 1

Solution:
Sudo apt-Get install libx11-dev

Error:
SH: gperf: not found
Calling gperf failed: 32512 at./makeprop. pl line 96.
Make: *** [out/target/product/generic/obj/static_libraries/libwebcore_intermediates/WebCore/CSS/csspropertynames. H] Error 25
Make: *** deleting file 'out/target/product/generic/obj/static_libraries/libwebcore_intermediates/WebCore/CSS/csspropertynames. H'

Solution:
Sudo apt-Get install gperf

Error:
Build/CORE/Java. mk: 9: *** bin: Target Java module does not define any source or resource files. Stop.

Solution:
Delete the bin folder under the root directory of the source code. This folder is created when eclipse is imported.

10. Related Materials
A. http://source.android.com/source/initializing.html;
B. mini6410 user manual.

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.