It sounds like your cc_library is setting sdk_version: "XX" (so it's built against the NDK), but your cc_prebuilt_library_shared is not (so it's claiming it was built against the platform APIs, which contains APIs that may change from release to release). If your prebuilt was actually built against the NDK, you should specify which version it was built against. If not, remove the sdk_version from your cc_library.
Also, instead of using `include_dirs` in your cc_library, you can use `export_include_dirs` in your prebuilt library to expose a set of headers to everything that links to that library. We'd eventually like to get rid of include_dirs (not local_include_dirs). See https://android.googlesource.com/platform/build/soong/+/master/docs/best_practices.md#headers for more discussion around this. - Dan On Fri, Feb 7, 2020 at 11:13 AM Shalini Salomi Bodapati <[email protected]> wrote: > Hi All, > > I facing the below error when trying to add a prebuilt shared library in > Android.bp file. > > My approach: > > cc_prebuilt_library_shared { > name: "my-lib", > srcs: ["path-to-my-lib/my-lib.so"], > } > cc_librray { > <existing code> > shared_libs : ["my-lib"], > include_dirs : ["path to .h files"] > } > > *module "X" variant "bbbb": depends on non-NDK-built library "my-lib"* > > Any help is appreciated. > > Thanks in Advance! > > -- > -- > You received this message because you are subscribed to the "Android > Building" mailing list. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-building?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "Android Building" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-building/bf51066b-6143-451f-ba11-840af2695d7a%40googlegroups.com > <https://groups.google.com/d/msgid/android-building/bf51066b-6143-451f-ba11-840af2695d7a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-building?hl=en --- You received this message because you are subscribed to the Google Groups "Android Building" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHd%3DQ%2BV1HbLBx4G-%3DU3EiLyW0SRCwupto3SiWn%3DdM-4S1oA%40mail.gmail.com.
