欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

android R编译OTA时报“ExternalError: Invalid ro.product.property_source_order”解决方法

发布时间:2025/3/15 编程问答 6 豆豆
生活随笔 收集整理的这篇文章主要介绍了 android R编译OTA时报“ExternalError: Invalid ro.product.property_source_order”解决方法 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

在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 mainFile "/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 AddImagesToTargetFilesFile "/home/xxxx/yourdevice_r_1.0_dev_0616/android/out/host/linux-x86/bin/add_img_to_target_files/common.py", line 701, in LoadInfoDictbuild_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 GetOemPropertyreturn 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 GetBuildPropreturn 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

总结

以上是生活随笔为你收集整理的android R编译OTA时报“ExternalError: Invalid ro.product.property_source_order”解决方法的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。