在AOSP构建中找不到资源错误

时间:2018-06-25 09:54:32

标签: android android-make

当我在AOSP构建树中构建android应用程序时,它会产生以下错误。

error: resource style/Base.Widget.AppCompat.Button (aka com.sample.application:style/Base.Widget.AppCompat.Button) not found.
error: resource style/Base.Widget.AppCompat.Button (aka com.sample.application:style/Base.Widget.AppCompat.Button) not found.
error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.sample.application:style/Theme.AppCompat.Light.NoActionBar) not found.
vendor/sample/apps/SampleApplication2/res/values/styles.xml:6: error: style attribute 'attr/colorPrimary (aka com.sample.application:attr/colorPrimary)' not found.
vendor/sample/apps/SampleApplication2/res/values/styles.xml:7: error: style attribute 'attr/colorPrimaryDark (aka com.sample.application:attr/colorPrimaryDark)' not found.
vendor/sample/apps/SampleApplication2/res/values/styles.xml:8: error: style attribute 'attr/colorAccent (aka com.sample.application:attr/colorAccent)' not found.

我的Android.mk如下

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PACKAGE_NAME := SampleApplication2
LOCAL_MODULE_TAGS  := optional
LOCAL_CERTIFICATE  := platform
# SRC files
 LOCAL_SRC_FILES := \
    $(call all-java-files-under, java) \
    $(call all-named-files-under, *.aidl, aidl)
# RES files
LOCAL_RESOURCE_DIR := \
    res
LOCAL_USE_AAPT2 := true
LOCAL_AAPT_FLAGS := --auto-add-overlay \
--extra-packages android.support.compat \
--extra-packages android.support.v7.appcompat \
--extra-packages android.support.v7.recyclerview

#Include Static libraries

LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-annotations
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_APPS)

include $(BUILD_PACKAGE)

LOCAL_SRC_FILES := $(call all-subdir-java-files)

如果有任何错误,请更正我的android.mk文件 任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

您必须参考以下资源

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
frameworks/support/v7/appcompat/res \
frameworks/support/design/res
相关问题