error: failed parsing overlays when build AOSP source

强颜欢笑 提交于 2021-01-27 12:50:55

问题


Today I has downloaded AOSP and I am trying build newest android version with lunch option is aosp_car_x86-userdebug But after about 50 minutes, I got the message log as below...

warn: removing resource com.android.bluetooth:string/map_acceptance_timeout_message without required default value. warn: removing resource com.android.bluetooth:string/map_auth_notif_message without required default value. warn: removing resource com.android.bluetooth:string/map_auth_notif_ticker without required default value. warn: removing resource com.android.bluetooth:string/map_auth_notif_title without required default value. warn: removing resource com.android.bluetooth:string/map_authentication_timeout_message without required default value. warn: removing resource com.android.bluetooth:string/map_defaultname without required default value. warn: removing resource com.android.bluetooth:string/map_defaultnumber without required default value. warn: removing resource com.android.bluetooth:string/map_localPhoneName without required default value. warn: removing resource com.android.bluetooth:string/map_session_key_dialog_header without required default value. warn: removing resource com.android.bluetooth:string/map_session_key_dialog_title without required default value. warn: removing resource com.android.bluetooth:string/map_unknownName without required default value. [ 70% 51582/73245] AAPT2 link out/target/product/generic_x86/obj/APPS/Contacts_intermediates/package-res.apk warn: removing resource com.android.contacts:bool/config_editor_include_phonetic_name without required default value. [ 70% 51584/73245] //frameworks/base/packages/SettingsLib:SettingsLib aapt2 link FAILED: out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/package-res.apk out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/proguard.options out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/R.jar out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/R.txt out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/extra_packages out/soong/host/linux-x86/bin/aapt2 link -o out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/package-res.apk --no-static-lib-packages --manifest out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/manifest_fixer/AndroidManifest.xml --min-sdk-version 21 --target-sdk-version 21 --version-code 28 --version-name Q -I out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.legacy_legacy-support-v4/android_common/package-res.apk -I out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.recyclerview_recyclerview/android_common/package-res.apk -I out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.preference_preference/android_common/package-res.apk -I out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.appcompat_appcompat/android_common/package-res.apk -I out/soong/.intermediates/prebuilts/sdk/current/androidx/androidx.lifecycle_lifecycle-runtime/android_common/package-res.apk -I out/soong/.intermediates/frameworks/base/core/res/framework-res/android_common/package-res.apk --static-lib --java out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/aapt2/R --proguard out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/proguard.options --output-text-symbols out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/R.txt @out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/res.list -R @out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/overlay.list && out/soong/host/linux-x86/bin/soong_zip -write_if_changed -jar -o out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/R.jar -C out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/aapt2/R -D out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/aapt2/R &&out/soong/host/linux-x86/bin/extract_jar_packages -i out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/gen/R.jar -o out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/extra_packages --prefix '--extra-packages ' out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/drawer_icon_margin does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/drawer_icon_size does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/drawer_item_top_bottom_margin does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/drawer_spacer_height does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/drawer_width does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/medium_text_size does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/normal_icon_size does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: resource dimen/small_text_size does not override an existing resource. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: note: define an tag or use --auto-add-overlay. out/soong/.intermediates/frameworks/base/packages/SettingsLib/SettingsLib/android_common/aapt2/packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values_dimens.arsc.flat: error: failed to merge resource table. error: failed parsing overlays. 15:45:18 ninja failed with: exit status 1

failed to build some targets (46:10 (mm:ss))

Could you please take a look and tell me what are problem with my issue.


回答1:


I had run into similar issue. Just add below code for each problematic resource in file :

packages/services/Car/car_product/overlay/frameworks/base/packages/SettingsLib/res/values/dimens.xml

<add-resource type="dimen" name="small_text_size"></add-resource>

It would work.




回答2:


It looks like that there is missing some resource. Please copy the missing resource to SettingsLib/SettingsLib/res/dimens.xml. the missing resource is in here

Please remember to remove the "normal_icon_size" item. because it has been added to the dimens.xml file.




回答3:


It's a common issues when upgrading to new AOSP codebase on your existing AOSP changes. To support target specific resource changes, AOSP provides overlay where we can change the resources values as per the target need.

Problem:

Let's understand when this error will come.

For example if there is some AOSP package named "SettingsProvider" which has a string resource named as "should_provide_gps" and is not present anymore in new AOSP codebase But your target overlay has that variable.

Solution:

Remove that variable from overlay because overlay is meant to be overriden existing resources. If no such resource is present in the given path, then having same resource in overlay does not make any sense.



来源:https://stackoverflow.com/questions/52513958/error-failed-parsing-overlays-when-build-aosp-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!