"Go" ubuntu11.10 64bit environment Android compilation error

Source: Internet
Author: User

Original URL: http://blog.csdn.net/lmhgen/article/details/7326083

Error 1:

Note: External/protobuf/java/src/main/java/com/google/protobuf/generatedmessagelite.java is using an unchecked or unsafe operation.

Note: To learn more, recompile with-xlint:unchecked.
Note: External/protobuf/java/src/main/java/com/google/protobuf/micro/codedinputstreammicro.java is using an unchecked or unsafe operation.
Note: To learn more, recompile with-xlint:unchecked.
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" redefined [enabled by default]
<built-in>:0:0: Note: This is the previously defined location
< command line >:0:0: Warning: "_fortify_source" redefined [enabled by default]
<built-in>:0:0: Note: This is the previously defined location
In 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
Compile interrupts.
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
Compile interrupts.
Make: * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBHOST_INTERMEDIATES/COPYFILE.O] Error 1
Make: * * is waiting for unfinished tasks ....
Make: * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/ACP_INTERMEDIATES/ACP.O] Error 1
< command line >:0:0: Warning: "_fortify_source" redefined [enabled by default]
<built-in>:0:0: Note: This is the 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
Compile interrupts.

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

Note: Some of the input files use or overwrite outdated APIs.
Note: To learn more, recompile with-xlint:deprecation.
Note: Some input files use an unchecked or unsafe operation.

Note: To learn more, recompile with-xlint:unchecked.

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: ' const Android::refbase::weakref_impl ' as ' void Android::RefBase ' :: Weakref_impl::trackme (BOOL, bool) ' ' This ' argument is discarded when the type is qualified [-fpermissive]
Make: * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/REFBASE.O] Error 1
Make: * * is waiting for unfinished tasks ....
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: Converting an integer to a different size pointer [-wint-to-pointer-cast]

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

Refer to the solution on the Internet:

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

Put 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 has not been solved, but a new error has arisen:

Host C + +: Libutils <= frameworks/base/libs/utils/asset.cpp
G++:–fpermissive: No file or directory
Note: Some of the input files use or overwrite outdated APIs.
Note: To learn more, recompile with-xlint:deprecation.
Note: Some input files use an unchecked or unsafe operation.
Note: To learn more, recompile with-xlint:unchecked.
Make: * * [OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/ASSET.O] Error 1
Make: * * * Deleting file "OUT/HOST/LINUX-X86/OBJ/STATIC_LIBRARIES/LIBUTILS_INTERMEDIATES/ASSET.O"

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

This error is mainly due to the GCC version being too high: The Final Solution is:

(11.10 of GCC versions are 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, error compiling Android, to change the GCC version to 4.4.3.

The GCC-V command allows you to discover the GCC library under the/usr/lib/gcc/i686-linux-gnu directory, which has various versions of the GCC libraries currently supported by the system. There are no 4.4 directories in this directory before GCC 4.4 is installed, and after installing GCC 4.4 The directory will be 4.4 more, and there are various corresponding library files in 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 additional commands are required, or compile-time errors may occur.

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

To find that GCC is linked to gcc-4.6, you need to change it to link to gcc-4.4:

sudo mv gcc Gcc.bak

sudo ln-s gcc-4.4 gcc

$ls-L g++*

Sudo-s

MV g++-4.4 g++

g++-V

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 tasks ....
Make: * * [out/host/linux-x86/obj/lib/libesr_portable.so] Error 1

Workaround:

Input: sudo apt-get install Gcc-multilib

New issues 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 tasks ....
Make: * * [out/host/linux-x86/obj/lib/libesr_portable.so] Error 1

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

Workaround

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 tasks ....
Make: * * [Out/target/common/docs/doc-comment-check-timestamp] Error 45

Workaround:

This is because Clearsilver uses 64-bit compilation when 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 build 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 and continue with 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 under 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

"Go" ubuntu11.10 64bit environment Android compilation error

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.