You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to build google/nearby Connections API using the Bazel build system on my Windows machine. I am trying to generate a .so file from this so that I can include it in my android app.
When I build using the following command without making any changes to the code, I am getting a core.lib file: -
To get a .so file as output, I have a genrule to the BUILD file under nearby/connections : -
genrule(
name = "coreshared",
srcs = [":core"], # Refer to the cc_library
outs = ["coreshared.so"],
cmd = "cp ./$(location core) ./$(location coreshared.so)",
)
This does generate coreshared.so under bazel-bin/connections, but when I try to consume the generated .so file from the Android app I am getting an error- ld.lld: error: 'coreshared.so' is neither ET_REL nor LLVM bitcode
I am sorry if there is something very obviously wrong in my approach 😅, I am very new to both Bazel and Android. Can someone please help me in pointing what I am missing here?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Everyone,
I have been trying to build google/nearby Connections API using the Bazel build system on my Windows machine. I am trying to generate a .so file from this so that I can include it in my android app.
When I build using the following command without making any changes to the code, I am getting a core.lib file: -
bazel build -s --check_visibility=false //connections:core --spawn_strategy=standalone --verbose_failures
To get a .so file as output, I have a genrule to the BUILD file under nearby/connections : -
genrule(
name = "coreshared",
srcs = [":core"], # Refer to the cc_library
outs = ["coreshared.so"],
cmd = "cp ./$(location core) ./$(location coreshared.so)",
)
This does generate coreshared.so under bazel-bin/connections, but when I try to consume the generated .so file from the Android app I am getting an error- ld.lld: error: 'coreshared.so' is neither ET_REL nor LLVM bitcode
I am sorry if there is something very obviously wrong in my approach 😅, I am very new to both Bazel and Android. Can someone please help me in pointing what I am missing here?
Thanks for your time in advance.
Beta Was this translation helpful? Give feedback.
All reactions