首页 > 解决方案 > 如何从 Android.mk 构建错误中获取 LOCAL_STATIC_ANDROID_LIBRARIES 名称?

问题描述

我在mm使用 AOSP 和 Android.mk 运行构建时收到此构建错误

error: resource style/Theme.MaterialComponents.DayNight.DarkActionBar (aka missing.manifest:style/Theme.MaterialComponents.DayNight.DarkActionBar) not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:5: error: style attribute 'attr/colorPrimary (aka missing.manifest:attr/colorPrimary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:6: error: style attribute 'attr/colorPrimaryVariant (aka missing.manifest:attr/colorPrimaryVariant)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:7: error: style attribute 'attr/colorOnPrimary (aka missing.manifest:attr/colorOnPrimary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:9: error: style attribute 'attr/colorSecondary (aka missing.manifest:attr/colorSecondary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:10: error: style attribute 'attr/colorSecondaryVariant (aka missing.manifest:attr/colorSecondaryVariant)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:11: error: style attribute 'attr/colorOnSecondary (aka missing.manifest:attr/colorOnSecondary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values/themes.xml:13: error: resource attr/colorPrimaryVariant (aka missing.manifest:attr/colorPrimaryVariant) not found.
error: resource style/Theme.MaterialComponents.DayNight.DarkActionBar (aka missing.manifest:style/Theme.MaterialComponents.DayNight.DarkActionBar) not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:5: error: style attribute 'attr/colorPrimary (aka missing.manifest:attr/colorPrimary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:6: error: style attribute 'attr/colorPrimaryVariant (aka missing.manifest:attr/colorPrimaryVariant)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:7: error: style attribute 'attr/colorOnPrimary (aka missing.manifest:attr/colorOnPrimary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:9: error: style attribute 'attr/colorSecondary (aka missing.manifest:attr/colorSecondary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:10: error: style attribute 'attr/colorSecondaryVariant (aka missing.manifest:attr/colorSecondaryVariant)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:11: error: style attribute 'attr/colorOnSecondary (aka missing.manifest:attr/colorOnSecondary)' not found.
vendor/qcom/opensource/iot-media/mediadecode/app/src/main/res/values-night/themes.xml:13: error: resource attr/colorPrimaryVariant (aka missing.manifest:attr/colorPrimaryVariant) not found.
error: failed linking references.
14:15:24 ninja failed with: exit status 1

#### failed to build some targets (02:52 (mm:ss)) ####

我尝试了很多但没有找到要添加的库(以及确切的名称)

LOCAL_STATIC_ANDROID_LIBRARIES := \
    androidx.appcompat_appcompat \
    androidx-constraintlayout_constraintlayout \
    androidx-navigation_navigation-ui \
    androidx-navigation_navigation-fragment \
    ...

肯定看起来不一样

implementation 'com.google.android.material:material:<version>'

在 Gradle 中使用。

如何修复此构建错误?

标签: androidbuildandroid-source

解决方案


推荐阅读