ANDROIDMK翻译错误:Android.bp中不支持包含



我正试图将include fwk/base/pkgs/SettingsLib/common.mk添加到设置应用程序中,但不确定如何在Android.bp文件中使用它。

我使用了AOSP构建系统附带的androidmk转换工具将Android.mk转换为Android.bp

我所做的:

1. On AOSPSource code, check build/soong/androidmk and make full build.
2. After compiling the source code, the androidmk generation tool located :
# out/soong/host/linux-x86/bin/androidmk
3. Using the androidmk command try converting my Android.mk to Android.bp
# androidmk Android.mk > Android.bp

Android.bp 内部错误

20 // **ANDROIDMK TRANSLATION ERROR: unsupported include**
21 // include frameworks/base/packages/SettingsLib/search/common.mk$

有什么建议吗?提前谢谢。

找到了将Android.mk转换为Android.bp并在应用程序上导入的方法。

核心AOSP androidmk工具没有帮助,我们需要在SettingsLibs上手动创建SettingsLibDefaults(在任何libs上创建Defaults(。引用的AOSP设置Lib Android.bp文件。

// NOTE: Keep this module in sync with ./common.mk
java_defaults {
name: "SettingsLibDefaults",
static_libs: [
"androidx.annotation_annotation",
"androidx.lifecycle_lifecycle-common",
"androidx.legacy_legacy-support-v4",
"androidx.lifecycle_lifecycle-runtime",
"androidx.recyclerview_recyclerview",
"androidx.preference_preference",
"androidx.appcompat_appcompat",
"androidx.legacy_legacy-preference-v14",
"SettingsLib",
],
}

在设置应用程序Android.bp文件上使用SettingsLibDefaults

android_library {
name: "Settings-core",
platform_apis: true,
defaults: [
"SettingsLibDefaults",
"SettingsLib-search-defaults",
],

同样,我们需要在任何libs Android.bp文件上创建一个默认值,并在应用程序上导入。

最新更新