-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
building cc_library target for inclusing in android app #64
Comments
To build the Lyra encoder and decoder using fixed point weights:
To build for android, you also have to add an additional |
Hi,
it fails with error like this: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN11chromemedia5codec26kNumExpectedOutputFeaturesE" referenced by "/data/app/com.example.android.lyra-9rYYUaE5xu0iD0jGIXmw-g==/base.apk!/lib/arm64-v8a/liblyra_encoder.so"... I put .so files under right architecture jniLibs->amr64-v8a->lyra_encoder.so, lyra_decoder.so, libc++_shared.so When checking location of kNumExpectedOutputFeatures variable I can see that it is located in lyra_config.h/cc. So, I'm not sure what I'm missing and I would appreciate any help (should I add headers in build somehow?). Thanks in advance. |
I wouldn't know, cause I never tried to build the so library and load it from Java (see our android example), maybe someone else can chime in? @nsornin, did you end up figuring this out? |
Eventually, I figured it out. Instead of this approach, I followed your android example and made another example app but just with android_binary linking encode and decode API classes. Afterwards I gathered the .so file from the resulting .apk file. |
I am glad to hear that you figured it out. And thank you for sharing, so that your workaround can help other people trying to achieve the same thing :) |
@bkekelic2 Hi, can you tell me in detail how you solved it. I also want to call in android studio with .so file. |
Hi @JetaimeCat. I can't share the code, but here are detailed steps. So, first I cloned android_example and created new one - wrapper_example. For using it in android studio, copy it under proper architecture folder and copy Lyra.java wrapper also inside proper project structure folder. And that's it. Extra: you can check bottom of this conversation/issue for some extra info regarding Lyra and android. Hope this helps. 😉 |
@bkekelic2 Hi, I also try to build my own app with separate encode and decode methods, I follow the steps to first build the lyra example app, and then build the app with the separate methods. But after I installed the lyra example app to my phone, I encountered a crash, it seems that the Android failed to open the .so file. Do you have a clue for this problem, or if it ok for you to share the .so file? Really appreciate your help. |
Firstly, you can check whether device architecture is the same as the architecture for which you built the .so file. |
dear all.
I am trying to build a .so library fro the encoder and decoder for inclusion in an android app under android studio.
The tutorial says to build the cc_library but i have no idea what that means.
Could someone kindly provide an example bazel command line for this ?
Thank you so much !
The text was updated successfully, but these errors were encountered: