Search code examples
androidandroid-6.0-marshmallowcyanogenmod

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


I'm getting the following error while building Android ROM, either it is 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.

When I look into the path in github.com/CyanogenMod and github.com/Android I couldn't find sap-api.pb.h What could be the problem and how can I resolve it?


Solution

  • I got the same error message, and I tried to find the generated file with find command:

    $ 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
    

    then I notice the #include path is a bit different from the real path, I open the error .h file and change hardware/ril/... to hardware/ril-caf/... in these two files:

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

    Then, the build passed.

    Hope this help.