Android 2.3.1 Error resolution in Ubuntu 14.04 compilation

Source: Internet
Author: User

first, you must reduce GCC version:

sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo rm-rf/usr/bin/gcc/usr/bin/g++
sudo ln-s/USR/BIN/GCC-4.4/USR/BIN/GCC
sudo ln-s/usr/bin/g++-4.4/usr/bin/g++

?

?

################ Fix 1 ##########################

Error:

Frameworks/base/include/utils/keyedvector.h:193:31:note:declarations in dependent base ' android::keyedvector< Android::string8, android::sp<aaptdir> > ' is not found by unqualified lookup

Frameworks/base/include/utils/keyedvector.h:193:31:note:use ' This->indexofkey ' instead

Make: * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/AAPT_INTERMEDIATES/AAPTASSETS.O] Error 1

Fix:
VI frameworks/base/tools/aapt/android.mk

Add '-fpermissive ' to line 31:
Local_cflags + =-wno-format-y2k-fpermissive

################## Fix 2 ##########################

Error
:

Frameworks/base/include/utils/keyedvector.h:193:31:error: ' Indexofkey ' is not declared in this scope, and no declaratio NS were found by Argument-dependent lookup at the point of instantiation [-fpermissive]

Frameworks/base/include/utils/keyedvector.h:193:31:note:declarations in dependent base ' android::keyedvector< Android::string8, android::wp<android::assetmanager::sharedzip> > ' is not found by unqualified lookup


Frameworks/base/include/utils/keyedvector.h:193:31:note:use ' This->indexofkey ' instead

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

Fix:
VI frameworks/base/libs/utils/android.mk

Add '-fpermissive ' to line 64:
Local_cflags + =-dlibutils_native=1 $ (tool_cflags)-fpermissive

?

question three
External/srec/tools/thirdparty/openfst/fst/lib/cache.h:132:26:note:declarations in dependent base ' FST:: Vectorfstbaseimpl<fst::cachestate<fst::gallicarc<fst::stdarc, (fst::stringtype) 0u> > > ' is not Found by unqualified lookup
External/srec/tools/thirdparty/openfst/fst/lib/cache.h:132:26:note:use ' This->setstate ' instead
External/srec/tools/thirdparty/openfst/fst/lib/cache.h:136:61:error:? ' SetState ' is not declared in this scope, and no declarations were found by Argument-dependent? Lookup at the Poin t of instantiation [-fpermissive]
SetState (Cache_first_state_id_, Cache_first_state_);

Make: * * * [OUT/HOST/LINUX-X86/OBJ/EXECUTABLES/GRXMLCOMPILE_INTERMEDIATES/GRXMLCOMPILE.O] Error 1

Workaround:
CD External/srec
Wget "Https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff "
Patch-p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
Rm-f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
Cd.. /..

This method is I find others for the 4.0 version of the source code problem resolution, I used on 2.3, no problem

Dalvik_system_zygote.c:191:19:error:storage size of ' rlim ' isn ' t known

Solutions
Add header file #include <sys/resource.h> to the following file
Dalvik/vm/native/dalvik_system_zygote.cpp?

?

<command-line>:0:0: Error:? "_fortify_source" redefined? [ -werror]

Solutions
GCC
and g++ versions are too high.
sudo apt-get install gcc-4.4
sudo apt-get install g++-4.4
sudo rm-rf/usr/bin/gcc/usr/bin/g++
sudo ln-s/USR/BIN/GCC-4.4/USR/BIN/GCC
sudo ln-s/usr/bin/g++-4.4/usr/bin/g++

?

Can ' t locate switch.pm in @INC (if you are need to install the Switch module) (@INC

? contains:external/webkit/webcore/bindings/scripts/etc/perl/usr/local/lib/per

l/5.18.2/usr/local/share/perl/5.18.2/usr/lib/perl5/usr/share/perl5/usr/lib/p

Erl/5.18/usr/share/perl/5.18/usr/local/lib/site_perl.) At External/webkit/web

core/dom/make_names.pl Line 38.

BEGIN failed--compilation aborted at external/webkit/webcore/dom/make_names.pl l

INE 38.

Can ' t locate switch.pm in @INC (if you are need to install the Switch module) (@INC

? contains:external/webkit/webcore/bindings/scripts/etc/perl/usr/local/lib/per

l/5.18.2/usr/local/share/perl/5.18.2/usr/lib/perl5/usr/share/perl5/usr/lib/p

Erl/5.18/usr/share/perl/5.18/usr/local/lib/site_perl.) At External/webkit/web

core/dom/make_names.pl Line 38.

BEGIN failed--compilation aborted at external/webkit/webcore/dom/make_names.pl l

INE 38.

?

The workaround is to install Perl of the Switch Library:

[plain]? View Plain Copy

    1. Sudo?apt-get?install?libswitch-perl??

Android 2.3.1 Error resolution in Ubuntu 14.04 compilation

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.