ndk icon indicating copy to clipboard operation
ndk copied to clipboard

Support cargo's library name property

Open evant opened this issue 4 years ago • 3 comments

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.

evant avatar Mar 26 '21 01:03 evant

Hitting the same issue, I suppose this is hardcoded somewhere

maxammann avatar Apr 22 '22 19:04 maxammann

I started fixing this a while ago in https://github.com/dvc94ch/cargo-subcommand/pull/17.

MarijnS95 avatar Apr 22 '22 21:04 MarijnS95

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.

rib avatar May 23 '22 02:05 rib