在make dist DIST_DIR=mydist编译OTA包时,遇到个错误,在以前android版本中倒是没有遇到过,这里记录一下。
报错内容:
2021-07-02 09:53:29 - common.py - WARNING : Failed to read ODM/build.prop
2021-07-02 09:53:29 - add_img_to_target_files.py - ERROR :
ERROR:
Traceback (most recent call last):
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 999, in <module>
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 993, in main
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/add_img_to_target_files.py", line 733, in AddImagesToTargetFiles
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 701, in LoadInfoDict
build_info = BuildInfo(d)
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 393, in __init__
self._device = self.GetOemProperty("ro.product.device")
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 509, in GetOemProperty
return self.GetBuildProp(key)
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 451, in GetBuildProp
return self._ResolveRoProductBuildProp(prop)
File "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 476, in _ResolveRoProductBuildProp
"Invalid ro.product.property_source_order '{}'".format(source_order))
**ExternalError: Invalid ro.product.property_source_order '['odm', 'vendor', 'product', 'product_services', 'system']'**
分析一下对应的common.py代码吧
common.py脚本
def _ResolveRoProductBuildProp(self, prop):
default_source_order = self._GetRoProductPropsDefaultSourceOrder()
source_order_val = self._GetRawBuildProp(
"ro.product.property_source_order", None)
source_order = source_order_val.split(",")
if any([x not in default_source_order for x in source_order]):
raise ExternalError(
"Invalid ro.product.property_source_order '{}'".format(source_order))#挂在这行
def _GetRoProductPropsDefaultSourceOrder(self):
...
return BuildInfo._RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT
_RO_PRODUCT_PROPS_DEFAULT_SOURCE_ORDER_CURRENT = [
"product", "odm", "vendor", "system_ext", "system"]
打开板卡中的systme.prop
ro.product.property_source_order=odm,vendor,product,product_services,system
可以看到这两者不匹配,导致报错。
修改一下system.prop中ro.product.property_source_order属性内容,让这两者相等即可,编译就不再报错了。
#ro.product.property_source_order=odm,vendor,product,product_services,system
ro.product.property_source_order=odm,vendor,product,system_ext,system
1106

被折叠的 条评论
为什么被折叠?



