ubuntu11.0.4 compiler Android__ubuntu

Source: Internet
Author: User

from 2.3, the JDK uses the 1.6 version and the Linux system to use 64 bits, so many of the tools have to be reinstalled.

The following are the problems that were encountered at the first compile time:

1, not enough permissions encountered many times
/BIN/BASH:PREBUILT/LINUX-X86/TOOLCHAIN/ARM-EABI-4.4.3/BIN/ARM-EABI-GCC: Not enough permissions
/BIN/BASH:PREBUILT/LINUX-X86/TOOLCHAIN/ARM-EABI-4.4.3/BIN/ARM-EABI-GCC: Not enough permissions
/bin/bash:build/core/find-jdk-tools-jar.sh: Not enough permissions
/bin/bash:build/tools/findleaves.py: Not enough permissions
/bin/bash:build/tools/findleaves.py: Not enough permissions
Checking Api:checkapi-last
/bin/bash:out/host/linux-x86/bin/apicheck: Not enough permissions

Solve:
chmod a+x PREBUILT/LINUX-X86/TOOLCHAIN/ARM-EABI-4.4.3/BIN/ARM-EABI-GCC
Add executable permissions to all files that do not have permissions

2.make: * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/ACP_INTERMEDIATES/ACP.O] Error 1
Compile under 32 digits, direct make is OK
In 64-bit compile, there will be some errors, additional installation of some packages:
     A, no gnu/stubs-32.h files:
     / 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
Workaround:
Determine if your system is x86_64 gnu/linux
        root@mm-desktop:/home/mm/android# uname-a
       Linux Mm-desktop 2.6.27-9-generic #1 SMP Thu Nov 22:15:32 UTC 2008 x86_64 gnu/linux
Install libc6-dev-i386
  &NB sp;  sudo apt-get install libc6-dev-i386

B. I can't find-lstdc++.
/usr/bin/ld:cannot find-lstdc++
Workaround:
Install G++-multilib,lib32z1-dev and Lib32ncurses5-dev
Apt-get Install g++-4.2-multilib Lib32z1-dev lib32ncurses5-dev


3.make: * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/ACP_INTERMEDIATES/ACP] Error 1
Install G++-4.5-multilib
$ sudo aptitude install Git-core GnuPG Flex Bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Zip Curl Li Bncurses5-dev Zlib1g-dev
sudo apt-get install Git-core GnuPG Flex Bison gperf build-essential Zip curl zlib1g-dev gcc-multilib g++-multilib libc6-d ev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev Java-common unixodbc

4.arm-eabi-gcc:error trying to exec ' cc1 ': execvp:no such file or directory

When colleagues make up kernel, they always report the following error ~ ~ The last discovery is the permissions of the cross compilation tool, Chmod-r 777 * on it
Arm-eabi-gcc:error trying to exec ' cc1 ': execvp:no such file or directory
To sum up:
1, confirm the Cross-compile directory in the path inside
2, confirm the existence of CC1
3, confirm the Cross compilation tool permissions

Excerpts:

Error handling
In Ubuntu10.10 (64-bit) compiled Android2.3 source code, encountered a variety of problems. Either the lack of this, or the less. 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

Solve:
sudo apt-get install libc6-dev-i386

Error:
Make: * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/ACP_INTERMEDIATES/ACP] Error 1

Solve:
sudo apt-get install g++-multilib

Error:
External/clearsilver/cgi/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

Solve:
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

Solve:
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

Solve:
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

Solve:
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

Solve:
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

Solve:
sudo apt-get install Libx11-dev

Error:
Sh:gperf:not found
Calling Gperf failed:32512 in./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 '

Solve:
sudo apt-get install gperf

Error:
Build/core/java.mk:9: * * bin:target java module does not define any source or resource files. Stop.

Solve:
Delete the Bin folder under the source root directory that was created when you imported eclipse.

Cannot find-lxxx
A similar error in all compilation processes is the lack of libraries such as LIBXXX, and the solution is:
First: Using the command: Apt-cache search XXX for library searches
Then: Find those Libxxx-dev such libraries to install, the command is: sudo apt-get install Libxxx-dev
Finally: continue to make

Build Firmware

1. Under the source root directory to perform:
. Build/envsetup.sh

2. Compile by all (make) or module (MMM)

need to compile with superuser, without a permission issue

3. Through export-p to see if the path of home is correct, otherwise modify the home lock point to the path of home/users, direct export home= "/home/user"
4. Create a new folder under the "/home/users" directory firmware
5. Execute under the Android source root directory./mkimage.sh

modify the path in the./mkimage.sh to the folder under the/home/users directory firmware

firmware is generated in firmware




Error 1:

Note: External/protobuf/java/src/main/java/com/google/protobuf/generatedmessagelite.java is using an unchecked or unsafe operation. Note: To get more information, use-xlint:unchecked to recompile.
Note: External/protobuf/java/src/main/java/com/google/protobuf/micro/codedinputstreammicro.java is using an unchecked or unsafe operation.
Note: To get more information, use-xlint:unchecked to recompile.
Generated: (Out/target/product/generic/android-info.txt)
Host C:ACP <= build/tools/acp/acp.c
Host C + +: Libhost <= build/libs/host/pseudolocalize.cpp
Host C:libhost <= build/libs/host/copyfile.c
< command line >:0:0: Warning: "_fortify_source" redefine [default enabled]
<built-in>:0:0: Note: This is a previously defined location
< command line >:0:0: Warning: "_fortify_source" redefine [default enabled]
<built-in>:0:0: Note: This is a previously defined location
In the file included from build/libs/host/copyfile.c:11:0:
BUILD/LIBS/HOST/INCLUDE/HOST/COPYFILE.H:5:22: Fatal error: sys/stat.h: no file or directory
Compilation interrupted.
In file included from/usr/include/stdlib.h:25:0,
From Build/tools/acp/acp.c:11:
/USR/INCLUDE/FEATURES.H:323:26: Fatal error: bits/predefs.h: no file or directory
Compilation interrupted.
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBHOST_INTERMEDIATES/COPYFILE.O] Error 1
Make: * * * is waiting for unfinished task ....
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/ACP_INTERMEDIATES/ACP.O] Error 1
< command line >:0:0: Warning: "_fortify_source" redefine [default enabled]
<built-in>:0:0: Note: This is a previously defined location
In file included from/usr/include/c++/4.6/x86_64-linux-gnu/32/bits/os_defines.h:40:0,
from/usr/include/c++/4.6/x86_64-linux-gnu/32/bits/c++config.h:392,
FROM/USR/INCLUDE/C++/4.6/STRING:40,
From Build/libs/host/include/host/pseudolocalize.h:4,
From Build/libs/host/pseudolocalize.cpp:1:
/USR/INCLUDE/FEATURES.H:323:26: Fatal error: bits/predefs.h: no file or directory
Compilation interrupted.

Make: * * * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBHOST_INTERMEDIATES/PSEUDOLOCALIZE.O] Error 1


Note: Some input files use or overwrite outdated APIs.
Note: To get more information, use-xlint:deprecation to recompile.
Note: Some input files use an unchecked or unsafe operation.

Note: To get more information, use-xlint:unchecked to recompile.

Workaround: sudo apt-get install libc6-dev-i386

Http://www.blogjava.net/ZircoN/archive/2011/11/13/363452.html

Error 2:
Frameworks/base/libs/utils/refbase.cpp: in member function ' void Android::refbase::weakref_type::trackme (bool, BOOL) ':
FRAMEWORKS/BASE/LIBS/UTILS/REFBASE.CPP:483:67: Error: Convert ' const android::refbase::weakref_impl ' as ' void android::RefBase :: Weakref_impl::trackme (BOOL, bool) ' ' This ' argument dropped type qualifier [-fpermissive]
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/REFBASE.O] Error 1
Make: * * * is waiting for unfinished task ....
Frameworks/base/libs/utils/resourcetypes.cpp: in member function ' void android::restable::p rint (BOOL) const ':
frameworks/base/libs/utils/resourcetypes.cpp:4369:84: Warning: Converts an integer to a pointer of a different size [-wint-to-pointer-cast]

FRAMEWORKS/BASE/LIBS/UTILS/RESOURCETYPES.CPP:4375:43: Warning: Converts an integer to a different size pointer [-wint-to-pointer-cast] reference online solution:

$ gedit Frameworks/base/libs/utils/android.mk

The following line

Local_cflags + +-dlibutils_native=1 $ (tool_cflags)

Change into

Local_cflags + +-dlibutils_native=1 $ (tool_cflags) –fpermissive

Http://www.blogjava.net/ZircoN/archive/2011/11/13/363452.html

The problem is not resolved, but there are new errors: Host C + +: Libutils <= frameworks/base/libs/utils/asset.cpp
G++:–fpermissive: No file or directory
Note: Some input files use or overwrite outdated APIs.
Note: To get more information, use-xlint:deprecation to recompile.
Note: Some input files use an unchecked or unsafe operation.
Note: To get more information, use-xlint:unchecked to recompile.
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/ASSET.O] Error 1
Make: * * * is deleting the file "OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/ASSET.O"

Make: * * * is waiting for unfinished task ....

This error is mainly due to the high version of GCC: The Final Solution is:
(GCC version 11.10 is too high

http://hi.baidu.com/designhouse/blog/item/fec5cdbf8d6a231618d81fc1.html)

The GCC version of Ubuntu 11.10 is 4.6.1, the version is too high, there is an error compiling Android, the GCC version is changed to 4.4.3.

The GCC-V command allows you to discover that the GCC library is in the/USR/LIB/GCC/I686-LINUX-GNU directory, which has various versions of the GCC libraries supported by the current system. There are no 4.4 directories in the directory before installing GCC 4.4, and after installing GCC 4.4 there will be 4.4 more in this directory, and there are various corresponding library files under the 4.4 directory.

The best way to install GCC 4.4 under the Ubuntu 32bit system is to use only the following two commands, no other commands are required, or there may be errors at compile time.

sudo apt-get install gcc-4.4

sudo apt-get install g++-4.4



After loading in the/usr/bin directory

$ ls-l gcc*

lrwxrwxrwx 1 root 7 2011-10-29 09:11 gcc-> gcc-4.6

-rwxr-xr-x 1 root root 224544 2011-10-06 05:47 gcc-4.4

-rwxr-xr-x 1 root root 302104 2011-09-17 05:43 gcc-4.6 found that GCC is linked to gcc-4.6 and needs to be changed to link to gcc-4.4:

sudo mv gcc Gcc.bak

sudo ln-s gcc-4.4 gcc

Error 3:
g++: g++: Selected Multilib ' not installed
Selected Multilib ' not installed
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/AIDL_INTERMEDIATES/AIDL] Error 1
Make: * * * is waiting for unfinished task ....
Make: * * * * [out/host/linux-x86/obj/lib/libesr_portable.so] Error 1

Workaround:

Input: sudo apt-get install Gcc-multilib

A new problem occurs after sudo apt-get install G++-multilib:


g++: g++: Host Sharedlib:libfst (out/host/linux-x86/obj/lib/libfst.so)
g++: Selected Multilib ' not installedselected multilib ' not installed

Selected Multilib ' not installed
Make: * * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/AIDL_INTERMEDIATES/AIDL] Error 1
Make: * * * is waiting for unfinished task ....
Make: * * * * [out/host/linux-x86/obj/lib/libesr_portable.so] Error 1

Make: * * * * [out/host/linux-x86/obj/lib/libfst.so] Error 1

Solving method


sudo apt-get install Libc6-dev ia32-libs lib32ncurses5-dev x11proto-core-dev libx11-dev Lib32readline-gplv2-dev Lib32z-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils

sudo apt-get install G++-4.4-multilib

Error 4:



Could not load ' clearsilver-jni '
Java.library.path = Out/host/linux-x86/lib
Could not load ' clearsilver-jni '
Java.library.path = Out/host/linux-x86/lib
Make: * * * * [Out/target/common/docs/api-stubs-timestamp] Error 45
Make: * * * is waiting for unfinished task ....
Make: * * * * [Out/target/common/docs/doc-comment-check-timestamp] Error 45

Workaround:

This is because Clearsilver uses 64-bit compilation if it detects the use of Java JDK 6 at compile time. To avoid this error, you need to modify the following four files:

* EXTERNAL/CLEARSILVER/CGI/ANDROID.MK
* EXTERNAL/CLEARSILVER/JAVA-JNI/ANDROID.MK
* EXTERNAL/CLEARSILVER/UTIL/ANDROID.MK
* EXTERNAL/CLEARSILVER/CS/ANDROID.MK

Note the following statements in the four makefile:

# This forces a 64-bit builds for JAVA6
# Comment by Easwy
# Local_cflags + =-m64
# Local_ldflags + =-m64

Then execute make clean in the External/clearsilver directory, then go back to the project root directory and continue make.

When the compilation is complete, the resulting image file is placed in the Out/target/product/generic directory.


Gedit/root/.bashrc
Export Path=/root/android/mydroid/out/host/linux-x86/bin: $PATH
Export Android_product_out=/root/android/mydroid/out/target/product/generic
Export Android_swt=/root/android/mydroid/out/host/linux-x86/framework

Run under the out/target/product/generic/directory in the source directory
Emulator-image system.img-data userdata.img-ramdisk ramdisk.img command

Error 5:

Emulator
Nand:could not write file system.img, file exists



compiling the Android source code

Follow the "Get Android Source code" section to install the required packages, or you'll get a lot of errors when compiling your source code. For convenience, all of the included columns that need to be installed are listed below, some of which are optional, but are best fitted, and before installing, it is best to update them first:


$ sudo aptitude update

$ sudo aptitude upgrade


Ubuntu Linux ( - bit x86 )


$ sudo aptitude install Git-core GnuPG Flex Bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Zip Curl Li Bncurses5-dev Zlib1g-dev make gcc g++ libc6‐dev patch texinfo ncurses‐dev python2.6 valgrind Lib32readline5-dev


$ sudo aptitude install SUN‐JAVA6‐JDK


Ubuntu Linux ( the bit x86 )


$ sudo apt-get install Git-core GnuPG Flex Bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Zip Curl Lib Ncurses5-dev Zlib1g-dev make gcc g++ libc6-dev patch texinfo ncurses-dev python2.6 valgrind gcc-multilib g++-multilib libc 6-dev-i386 lib32ncurses5-dev ia32-libs X11proto-core-dev libx11-dev Lib32readline5-dev


$ sudo ln-s/usr/lib32/libx11.so.6/usr/lib32/libx11.so

$ sudo aptitude install SUN‐JAVA6‐JDK


Basically install the package listed above, the compiler will not have too much problem, listed below I (64-bit machine, Ubuntu10.04 system) in the compilation of some errors, and in the case of errors, the relevant solution package. Although Google has described these required packages in the Android documentation, here's a statement that addresses these issues: http://code.google.com/p/android/issues/detail?id=1005


/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 Package: $ sudo aptitude install libc6-dev-i386


/usr/bin/ld:cannot find-lstdc++

Collect2:ld returned 1 exit status

Make: * * * [out/host/linux-x86/obj/executables/aidl_intermediates/aidl] Error 1


Dpkg-query-l &> packages.txt (this tool can be used to query the DPKG database)

Solution Package: $ sudo aptitude install G++-multilib


/usr/bin/ld:cannot find-lncurses

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.

Tags Index: