ndk
ndk copied to clipboard
Support cargo's library name property
If you have a specific library name specified in your Cargo.toml, it will change the name of the so file. ex:
[pacakge]
name = "foo"
[lib]
name = "bar"
cargo apk build
builds: target/aarch64-linux-android/debug/bar.so
and then errors with:
Error: Path "target/aarch64-linux-android/debug/foo.so" doesn't exist.
Hitting the same issue, I suppose this is hardcoded somewhere
I started fixing this a while ago in https://github.com/dvc94ch/cargo-subcommand/pull/17.
Similarly I have a number of Rust Android examples/tests that I've been putting together here including some NativeActivity based ones that can be built via cargo apk but I realized that I couldn't name the library libmain.so as I have been for other examples, which had been convenient for having one fewer string that needs to be updated in the right places (e.g. I also have an AndroidManifest.xml that specifies the .lib_name for being able to build with Gradle / Android Studio. I currently also have a jury rigged workflow for symbolizing backtraces on Android where it's slightly more convenient if I can assume a consistent library name across projects. Quite a minor issue in my case, but would be handy if configurable library names were possible.