I. Tools
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
two. JDK
Oracle official website Download jdk6_29 (bin file, note installation method, environment variables, update-alternative, etc.) http://www.oracle.com/technetwork/java/javase/ Archive-139210.html
Three. Version of gcc/g++
The default GCC g++ version is 4.6.3, which changes to 4.4. Steps:
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
Cd/usr/bin
Ls-l gcc*
sudo mv gcc Gcc.bak
sudo ln-s gcc-4.4 gcc
Ls-l g++*
sudo mv g++ G++.bak
sudo ln-s g++-4.4 g++
Gcc-v
g++-V
Four. Problems with the source
很多repo不能用,这个一般都可以:
curl
"http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo"
> ~/bin/repo
另外。init的时候用这个:
repo init -u git://git.omapzoom.org/platform/manifest -b android-4.0.1_r1
After repo sync appears "fatal:". /platform/abi/cpp.git ' does not appear to be a git repository ' solution, open the. Repo directory under the manifest.xml file (command vim Manifest.xml) and find the Fetch attribute, show fetch= ":" In my file, modify fetch to Fetch= "git://Git.omapzoom.org "
Five. Issues that occur after synchronization1. Error following error message:
[Plain]View Plaincopy
- Import includes File:out/target/product/mx3/obj/static_libraries/libwebcore_intermediates/import_includes
- Target Generated:libwebcore <= External/webkit/source/webcore/css/tokenizer.flex
- <span style= "RGB (255, 255, 51); >can ' t locate switch.pm in @INC (could need to install the Switch module) </span> (@INC contains:/etc/perl/usr /local/lib/perl/5.18.2/usr/local/share/perl/5.18.2/usr/lib/perl5/usr/share/perl5/usr/lib/perl/5.18/usr/share/ Perl/5.18/usr/local/lib/site_perl.) At external/webkit/source/webcore/make-hash-tools.pl Line 23.
- BEGIN failed--compilation aborted at external/webkit/source/webcore/make-hash-tools.pl Line 23.
- Can ' t locate switch.pm in @INC (if you are need to install the Switch module) (@INC contains:/ETC/PERL/USR/LOCAL/LIB/PERL/5 .18.2/usr/local/share/perl/5.18.2/usr/lib/perl5/usr/share/perl5/usr/lib/perl/5.18/usr/share/perl/5.18/usr/ Local/lib/site_perl.) At external/webkit/source/webcore/make-hash-tools.pl Line 23.
- BEGIN failed--compilation aborted at external/webkit/source/webcore/make-hash-tools.pl Line 23.
- Make: * * * [out/target/product/mx3/obj/static_libraries/libwebcore_intermediates/source/webcore/html/ DocTypeStrings.cpp] Error 2
- Make: * * * waiting for unfinished jobs ....
- Make: * * * [out/target/product/mx3/obj/static_libraries/libwebcore_intermediates/source/webcore/platform/ ColorData.cpp] Error 2
- Target Generated:libwebcore <= external/webkit/source/webcore/html/parser/htmlentitynames.in
The workaround is to install the switch library for Perl:
[Plain]View Plaincopy
- sudo apt-get install Libswitch-perl
2.dalvik/vm/native/dalvik_system_zygote.cpp:216:43:error: ' Setrlimit ' is not declared in this scope
Err = Setrlimit (contents[0], &rlim);
^
<command-line>:0:0: Warning: "_fortify_source" redefined [enabled by default]
Dalvik/vm/native/java_lang_float.cpp:1:0:note:this is the location of the previous definition
/*
^
Make: * * * [OUT/HOST/LINUX-X86/OBJ/SHARED_LIBRARIES/LIBDVM_INTERMEDIATES/NATIVE/DALVIK_SYSTEM_ZYGOTE.O] Error 1
Make: * * * waiting for unfinished jobs ....
Solutions
Add header file # include <sys/resource.h> to the following file
Dalvik/vm/native/dalvik_system_zygote.cpp
3.host Executable:emulator_renderer (out/host/linux-x86/obj/executables/emulator_renderer_intermediates/emulator _renderer)
/usr/bin/ld:out/host/linux-x86/obj/executables/emulator_renderer_intermediates/main.o:undefined reference to Symbol ' Xinitthreads '
Usr/lib/i386-linux-gnu/libx11.so.6:error adding symbols:dso missing from command line
Collect2:ld returned 1 exit status
Make: * * * [out/host/linux-x86/obj/executables/emulator_renderer_intermediates/emulator_renderer] Error 1
Make: * * * waiting for unfinished jobs ....
Workaround:
Modify the Development/tools/emulator/opengl/host/renderer/android.mk file
[Email protected]:/home/dzt/android/working_directory# ls
Abi CTS docs Frameworks Makefile prebuilt
Bionic Dalvik download.sh hardware NDK SDK
Bootable development download.sh~ Hs_err_pid6190.log out system
Build device external Libcore packages V8.log
[Email protected]:/home/dzt/android/working_directory# gedit development/tools/emulator/opengl/host/renderer/ Android.mk
Add a line: Local_ldlibs + =-lx11 Note It is best to copy the past, right easy to write wrong
Several problems in compiling Android4.0.1 on Ubuntu14.04