构建Android源$ C $ C [英] Building android source code
问题描述
我下载了Android的源来自source.android.com并遵循指令设置生成环境在Mac OS X,一切都正常,只是,当我运行make它给了我下面的错误
I downloaded android source from source.android.com and followed the instruction to setup build environment on MAC OS X, Everything went fine except when i run make it gives me following error
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=darwin
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
host C++: aapt <= frameworks/base/tools/aapt/AaptAssets.cpp
frameworks/base/tools/aapt/AaptAssets.cpp:2161:38: warning: unused parameter 'bundle' [-Wunused-parameter]
AaptAssets::slurpResourceZip(Bundle* bundle, const char* filename)
^
In file included from frameworks/base/tools/aapt/AaptAssets.cpp:5:
In file included from frameworks/base/tools/aapt/AaptAssets.h:10:
In file included from frameworks/base/include/utils/AssetManager.h:25:
frameworks/base/include/utils/KeyedVector.h:193:17: error: use of undeclared identifier 'indexOfKey'
ssize_t i = indexOfKey(key);
^
this->
frameworks/base/tools/aapt/AaptAssets.h:446:46: note: in instantiation of member function 'android::DefaultKeyedVector<android::String8, android::sp<AaptSymbols> >::valueFor' requested here
sp<AaptSymbols> sym = mNestedSymbols.valueFor(name);
^
frameworks/base/include/utils/KeyedVector.h:66:29: note: must qualify identifier to find this declaration in dependent base class
ssize_t indexOfKey(const KEY& key) const;
^
1 warning and 1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] Error 1
我刚开始在Android的,所以不要有任何线索,任何小的帮助也将是AP preciated
I just started in android so do not have any clue, any small help also would be appreciated
推荐答案
我终于想通了这个问题。 有一个在框架的源$ C $ C /基/有/ utils的/ KeyedVector.h错误:193
I finally figured out the problem. There's an error in the sourcecode of frameworks/base/include/utils/KeyedVector.h:193
一些成员函数要求范围解析操作符这 - >建立在MAC OS X Lion中的Android源用X code版本4.3.x和gcc版本4.9.2(Debian的4.9.2-10 )。 如果没有范围解析操作符编译器将无法识别功能的存在。
Some of the member functions require Scope resolution operator "this->" to build the android source on MAC OS X Lion with xcode 4.3.x and on gcc version 4.9.2 (Debian 4.9.2-10). Without scope resolution operator compiler will not be able to identify the existence of the function.
开放式框架/基/有/ utils的/ KeyedVector.h
Open frameworks/base/include/utils/KeyedVector.h
从更改行193:
ssize_t i = indexOfKey(key);
到
ssize_t i = this->indexOfKey(key);
和Android 4.0.1编译。
and Android 4.0.1 compiles.
这篇关于构建Android源$ C $ C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!