Several errors and solutions for compiling android on Ubuntu

Source: Internet
Author: User

After the android source code is compiled, various errors may occur immediately, because some dependent packages are not installed.

To avoid the following errors, installJdk1.5
It must be jdk1.5. Otherwise, it cannot be compiled.

Then, check whether the following dependency packages are installed:

Sudo apt-Get install bison libc6-dev-amd64 g ++-multilib zlib1g-dev lib64z1-dev flex libncurses5-dev libx11-dev gperf

The following are my errors and solutions:

/Bin/Bash: bison: Command not found
Checking build Tools versions...
**************************************** ********************
You are attempting to build with the incorrect version
Of Java.

Your version is:/bin/Bash: Java: The command cannot be found.
The correct version is 1.6.

Please follow the machine setup instructions

Http://source.android.com/source/download.html

**************************************** ********************
Build/CORE/Main. mk: 114: *** stop. Stop.

Solution:
Sudo apt-Get install bison

Install: Out/host/linux-x86/framework/droiddoc. Jar
Target generated: libclearsilver-JNI <= out/host/common/obj/java_libraries/clearsilver_intermediates/javalib. Jar
Host C: libclearsilver-JNI <= external/clearsilver/Java-JNI/j_neo_util.c
In file encoded ded from/usr/include/features. h: 378,
From/usr/include/string. h: 26,
From external/clearsilver/Java-JNI/j_neo_util.c: 1:
/Usr/include/GNU/stubs. h: 9: 27: Error: GNU/stubs-64.h: No file or directory
Make: *** [out/host/linux-x86/obj/shared_libraries/libclearsilver-jni_intermediates/j_neo_util.o] Error 1

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

Http://www.poemcode.net/2010/07/android-stubs-64/

Host sharedlib: libneo_util (Out/host/ linux-x86/obj/lib/libneo_util.so)
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/libstdc ++. So when searching for-lstdc ++
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/libstdc ++. A when searching for-lstdc ++
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/libstdc ++. So when searching for-lstdc ++
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/libstdc ++. A when searching for-lstdc ++
/Usr/bin/ld: cannot find-lstdc ++
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1

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

External/clearsilver/cgi. C: 22: 18: Error: zlib. H: No file or directory
External/clearsilver/cgi. C: In function 'cgi _ compress ':
External/clearsilver/cgi. C: 885: Error: 'z _ stream' undeclared (first use in this function)
External/clearsilver/cgi. C: 885: Error: (each undeclared identifier is reported only once
External/clearsilver/cgi. C: 885: Error: for each function it appears in .)
External/clearsilver/cgi. C: 885: Error: Expected '; 'before' stream'
External/clearsilver/cgi. C: 888: Error: 'stream' undeclared (first use in this function)
External/clearsilver/cgi. C: 888: Error: 'bytef' undeclared (first use in this function)
External/clearsilver/cgi. C: 888: Error: Expected expression before ') 'token
External/clearsilver/cgi. C: 889: Error: 'uint' undeclared (first use in this function)
External/clearsilver/cgi. C: 889: Error: Expected '; 'before' STR'
External/clearsilver/cgi. C: 890: Error: Expected expression before ') 'token
External/clearsilver/cgi. C: 892: Error: 'ullong' undeclared (first use in this function)
External/clearsilver/cgi. C: 892: Error: Expected ') 'before' stream'
External/clearsilver/cgi. C: 895: Error: 'alloc _ func' undeclared (first use in this function)
External/clearsilver/cgi. C: 895: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 896: Error: 'free _ func' undeclared (first use in this function)
External/clearsilver/cgi. C: 896: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 897: Error: 'voidpf 'undeclared (first use in this function)
External/clearsilver/cgi. C: 897: Error: Expected '; 'before numeric constant
External/clearsilver/cgi. C: 900: Error: 'z _ default_compression 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'z _ deflated 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'max _ wbits 'undeclared (first use in this function)
External/clearsilver/cgi. C: 900: Error: 'z _ default_strategy 'undeclared (first use in this function)
External/clearsilver/cgi. C: 901: Error: 'z _ OK 'undeclared (first use in this function)
External/clearsilver/cgi. C: 904: Error: 'z _ finish 'undeclared (first use in this function)
External/clearsilver/cgi. C: 905: Error: 'z _ stream_end 'undeclared (first use in this function)
External/clearsilver/cgi. C: In function 'cgi _ output ':
External/clearsilver/cgi. C: 1200: Error: 'z _ null' undeclared (first use in this function)
External/clearsilver/cgi. C: 1201: Error: Expected ') 'before' bytef'
External/clearsilver/cgi. C: 1201: Warning: Cast from pointer to integer of different size
External/clearsilver/cgi. C: 1218: Error: 'z _ deflated 'undeclared (first use in this function)
Make: *** [out/host/linux-x86/obj/shared_libraries/libneo_cgi_intermediates/cgi. O] Error 1

Solution:
Sudo apt-Get install zlib1g-dev

Host sharedlib: libneo_cgi (Out/host/linux-x86/obj/lib/libneo_cgi.so)
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/.../../libz. So when searching for-LZ
/Usr/bin/ld: Skipping incompatible/usr/lib/GCC/i486-linux-gnu/4.4.3/.../../libz. A when searching for-LZ
/Usr/bin/ld: Skipping incompatible/usr/lib/libz. So when searching for-LZ
/Usr/bin/ld: Skipping incompatible/usr/lib/libz. A when searching for-LZ
/Usr/bin/ld: cannot find-LZ
Collect2: LD returned 1 exit status
Make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

Solution:
Sudo apt-Get install lib64z1-dev

Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: In function 'int yyparse ()':
Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: 1827:
Warning: deprecated conversion from String constant to 'Char *'
Out/host/linux-x86/obj/executables/aidl_intermediates/aidl_language_y.cpp: 1970:
Warning: deprecated conversion from String constant to 'Char *'
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

Docs droiddoc: Out/target/common/docs/API-stubs
Cocould not load 'clearsilver-JNI'
Java. Library. Path = out/host/ linux-x86/lib
Make: *** [out/target/common/docs/API-stubs-timestamp] Error 45

Solution:
Install jdk1.5

Host executable: ADB (Out/host/linux-x86/obj/executables/adb_intermediates/ADB)
/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 libncurses5-dev

Host C: emulator <= external/qemu/Android/Main. c
In file encoded ded from external/qemu/Android/Main. C: 30:
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 55: 22: Error: X11/xlib. H: No file or directory
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 56: 23: Error: X11/xatom. H: No file or directory
In file encoded ded from external/qemu/Android/Main. C: 30:
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 73: Error: Expected specifier-qualifier-list before 'xevent'
Prebuilt/linux-x86/SDL/include/SDL/sdl_syswm.h: 86: Error: Expected specifier-qualifier-list before 'display'
External/qemu/Android/Main. C: In function 'main ':
External/qemu/Android/Main. C: 1281: Warning: Implicit declaration of function 'audio _ check_backend_name'
Make: *** [out/host/linux-x86/obj/executables/emulator_intermediates/Android/Main. O] Error 1

Solution:
Sudo apt-Get install libx11-dev

Generating csspropertynames. H <= csspropertynames. In
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 the file "Out/target/product/generic/obj/static_libraries/libwebcore_intermediates/WebCore/CSS/csspropertynames. H"

Solution:
Sudo apt-Get install gperf

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.