rustup: Can not install on android - target 'aarch64-linux-android' not found in channel.
Problem
When trying to install rustup using the linux command on the rustup site, when proceeding with install it gives me the following error:
Current installation options:
default host triple: aarch64-linux-android
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: default host triple is aarch64-linux-android
info: syncing channel updates for 'stable-aarch64-linux-android'
info: latest update on 2021-09-09, rust version 1.55.0 (c8dfcfe04 2021-09-06)
error: target 'aarch64-linux-android' not found in channel. Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets
Steps
- Use termux
- Install rustup using site command
- You get this error
Extra Info I tried to install the package rust from the termux package repositories, but it was a too old version for the application I wanted to run. After trying to install rustup using the linux command this is where the problem started.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (4 by maintainers)
I’d look to your upstream for that software and ask them to make a new release; or else use a non-android system such as Linux or Windows to cross-compile the software for android if I were you. Android really isn’t a good platform to be running compilers etc. in my opinion.
pkg install proot-distro proot-distro list proot-distro install ubuntu proot-distro login ubuntu
curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh
ok
Just use:
pkg install rustin termux@kenny-kvibe The toolchain you’ve installed is not officially distributed; rather, it’s distributed by the Termux project for you. In this case,
rustupas the official toolchain downloader is not very useful.@rodrigogs it is. I had to install cargo-ndk and android studio to get it working. Here are the notes I made:
Build for Android
You also need the android sdk and ndk. You can install them by first installing android studio, and then through the sdk manager. Install the oldest sdk version, and ndk version 20.1.x. After that, run
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/20.1.5948944or if~/Android/Sdk/ndk/20.1.5948944does not exist, find the correct directory. Then you can run the following to build for android aarch64:Here is a one-liner:
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/20.1.5948944&&rustup target install aarch64-linux-android&&cargo ndk -t aarch64-linux-android build --releaseIs it possible to use rust in termux?
Same problem
Same issue with me
yes
When I use
pkg install rustget this errorRunning the command suggestion got the same message
It’s unnecessary to build for Android. A solution is to use TermuxArch and then use rustup: `Current installation options:
default host triple: aarch64-linux-android default toolchain: stable (default) profile: default modify PATH variable: yes
I’m going to ask you the value of each of these installation options. You may simply press the Enter key to leave unchanged.
Default host triple? [aarch64-linux-android] aarch64-unknown-linux-gnu ` It builds for TermuxArch .
Any fixes?