I have set $RUSTUP_HOME and $CARGO_HOME to non-default values in my setup, and trying to build for android gave me the following results:
$ cargo android run
...
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:rustBuildArm64Debug'.
> Process 'command 'cargo'' finished with non-zero exit value 1
After some investigation, turns out cargo-android does not pass RUSTUP_HOME and CARGO_HOME environment variables down, resulting in the above error.
Current workaround: Make a symlink for each non-default path to the current one:
I have set
$RUSTUP_HOME
and$CARGO_HOME
to non-default values in my setup, and trying to build for android gave me the following results:After some investigation, turns out
cargo-android
does not passRUSTUP_HOME
andCARGO_HOME
environment variables down, resulting in the above error.Current workaround: Make a symlink for each non-default path to the current one: