5

I want to write a small .Net MAUI application which makes use of a C# SDK NuGet Package (implementing Hyperledger Anoncreds). When running the App on Android (emulator or device) most of the SDK method calls work, but certain calls still throw a DllNotFoundException without any indication of which Dll is actually missing.

After I did some reading on the SDK, I was able to add some .so dependencies to the MAUI project, but apparently there are still some missing.

I already tried reading through the SDK source code and some of the Rust code it wraps to get hunch of what could possibly be missing. But even wading through the cargo.toml files only show me the crates and not any actually libraries.

Android tools like "APK Analyzer" provide a lot of usefull information, but no dependency overview and the "Dependency Walker" tool only analyzes Windows-built binaries which differs from the actual Android environment.

How do I find the missing dependency indicated by the Exception? Is there a tool like "Dependency Walker" for Android APKs?

Edit: Fixed some typos and added more Info.

HPe
  • 91
  • 5
  • I would just like to add that the crates in `cargo.toml` are either libraries or bindings to existing libraries. Maybe check out the crates documentation on [crates.io](https://crates.io). Also please note that without specifying which SDK NuGet package are you using, other members who might be of an assistance won't be able to properly help you, as your post is lacking a minimal reproducible example or specific details to your problem. (And I do understand that you are asking rather for a specific tool/application) – Milan Š. Dec 19 '22 at 12:13
  • Thank you @MilanŠ. I just added the name of the Package. I tried to keep the question quite general without a specific package in mind, but maybe it helps. – HPe Dec 19 '22 at 13:02
  • Have you checked [this](https://github.com/hyperledger/indy-sdk) and tried out their setup for android/windows? I would assume that the SDK that you use might be different. But they do go over the details in the readme about the libs that they use and how to avoid them (openssl just to name one). I think that might be a good hint on what the SDK uses. However to answer your question I do believe that you might be able to use ldd on the binary to figure out what .so is missing. After all android is just linux. EDIT: Found an ldd equivalent for android and created an answer. Hope it helps. – Milan Š. Dec 19 '22 at 13:29

1 Answers1

0

After a quick google search for an equivalent of ldd on Android I found this: ndk-depends which should be shipped with Android NDK. I would try and use that on the .so files that you use and include with your project.

EDIT: Here is a link to the manual: ndk-depends

Hope it helps!

Milan Š.
  • 1,353
  • 1
  • 2
  • 11