Android12 OTA编译差分包报错问题

前言

在Ubuntu 20.04.4 LTS系统中编译Android12 OTA差分包的时候提示如下报错log:
 

Warning: releasetools script should be invoked as hermetic Python executable -- build and run `ota_from_target_files` directly.
Traceback (most recent call last):
  File "./build/tools/releasetools/ota_from_target_files", line 241, in 
    import ota_utils
  File "/home/server1/work/Android12/r12/build/make/tools/releasetools/ota_utils.py", line 21, in 
    import ota_metadata_pb2
  File "/home/server1/work/Android12/r12/build/make/tools/releasetools/ota_metadata_pb2.py", line 7, in 
    from google.protobuf import descriptor as _descriptor
ImportError: No module named google.protobuf
解决方法:


网上搜索了ImportError: No module named google.protobuf相关的资料,大部分都是建议使用重新安装protobuf。即:
pip uninstall protobuf
pip uninstall google
pip install google
pip install protobuf
试了以后,还是一样的提示上面的报错。

最终解决办法:

sudo apt-get install python-protobuf

你可能感兴趣的:(android系统,android12,OTA差分包,Ubuntu)