Android 6.0 构建错误 - sap-api.pb.h

Android 6.0 build error - sap-api.pb.h

我在构建 Android ROM 时遇到以下错误,要么是 AOSP/CyanogenMod

In file included from hardware/ril-caf/libril/RilSapSocket.cpp:21:0:
hardware/ril-caf/libril/RilSapSocket.h:22:55: fatal error: hardware/ril/librilutils/proto/sap-api.pb.h: No such file or directory
 #include <hardware/ril/librilutils/proto/sap-api.pb.h>
                                                       ^
compilation terminated.

当我查看 github.com/CyanogenMod 和 github.com/Android 中的路径时,我找不到 sap-api.pb.h 可能是什么问题,我该如何解决?

我得到了同样的错误信息,我试图用find命令找到生成的文件:

$ find . -name "sap-api.pb.h"
./out/target/product/bacon/gen/STATIC_LIBRARIES/librilutils_static_intermediates/proto/hardware/ril-caf/librilutils/proto/sap-api.pb.h
./out/target/product/bacon/gen/SHARED_LIBRARIES/librilutils_intermediates/proto/hardware/ril-caf/librilutils/proto/sap-api.pb.h

然后我注意到#include路径和真实路径有点不同,我打开错误.h文件并将这两个中的hardware/ril/...更改为hardware/ril-caf/...文件:

  • hardware/ril-caf/libril/rilSocketQueue.h
  • hardware/ril-caf/libril/RilSapSocket.h

然后,构建通过。

希望对您有所帮助。