0

I am trying to move my libs into product partition, and so that I have done all required changes and removed libandroid_runtime and libnativehelper because both are NON-ndk libs (both are using private apis). I was able to fix all the build time errors in android 30. But I am getting issue while building in Android S.

My 2 libs are using header_libs: ["jni_headers"], And when I try a full build or any app build I am getting below error for both libs -

FAILED: out/soong/.intermediates/mylib_path/android_product.S_arm_armv7-a-neon_cortex-a9_shared/mylib.so.toc
echo "module mylib missing dependencies: jni_headers{os:android,image:product.S,arch:arm_armv7-a-neon_cortex-a9,sdk:}" && false
module mylib missing dependencies: jni_headers{os:android,image:product.S,arch:arm_armv7-a-neon_cortex-a9,sdk:}

And if I remove this line I am getting missing #include <jni.h> header file error. So for the alternate purpose, I included jni.h file in my source code and now it's building perfectly. But I think this is not the right way to fix this.

Could you please look into this issue?

Thank you.

Bajrang Hudda
  • 3,028
  • 1
  • 36
  • 63

1 Answers1

1

I encountered a similar issue and was able to solve it by adding jni_headers as a header lib.

Here is a copy of my Android.bp:

cc_library {
    name: "libpinenote",
    host_supported: false,
    product_specific: true,

    srcs: ["cpp/*.cpp"],

    shared_libs: ["liblog"],
    header_libs: ["jni_headers"],

    cflags: [
        "-Wno-error-unused-parameter",
        "-fexceptions",
    ],
}