编译Android4.0.4常见错误 indexOfKey was not declared

来源:互联网 发布:北大网络教育怎么样 编辑:程序博客网 时间:2024/05/15 02:45
frameworks/base/include/utils/KeyedVector.h:193:31: note: declarations in dependent base ‘android::KeyedVector<android::String8, android::sp<AaptSymbols> >’ are not found by unqualified lookupframeworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ insteadframeworks/base/include/utils/KeyedVector.h: In instantiation of ‘const VALUE& android::DefaultKeyedVector<KEY, VALUE>::valueFor(const KEY&) const [with KEY = android::String16; VALUE = unsigned int]’:frameworks/base/tools/aapt/ResourceTable.h:485:100:   required from hereframeworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations 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::String16, unsigned int>’ are not found by unqualified lookupframeworks/base/include/utils/KeyedVector.h:193:31: note: use ‘this->indexOfKey’ instead
Fix:
vi frameworks/base/libs/utils/Android.mk

Add '-fpermissive' to line 60:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
vi frameworks/base/tools/aapt/Android.mk

Add '-fpermissive' to line 31:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive
两个都要
                                             
0 0