Closed slice-mohit closed 2 years ago
One of the best things about rust is how much the compiler helps you with useful error logs :)
= help: consider downloading the target with rustup target add aarch64-apple-ios
by default when you do cargo build --release it will build for the same platform you are running the command on. In your case m1 mac which i think is arm-apple-darwin or something like that. If you want to build for other target platforms you have to get the tool chain using rustup.
Thanks for the quick response. Looks like brew doesn't install rustup and usual install requires root access. Will check and get back to you tomorrow morning.
Refer to https://www.rust-lang.org/tools/install
This is the command to install rustup on any platform:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
I tried to run make android
on my ubuntu machine. There I installed rustup and ran rustup target add aarch64-linux-android
. I got a linking with `cc` failed
error.
make ios
works on mac but I'm getting same error (as on Ubuntu) with make android
.
if you want to build for android you will need to refer to this script:
https://github.com/StackmateNetwork/stackmate-core/blob/main/scripts/init.sh
Instead of running the script, I would suggest manually running line by line to understand the process first. It basically installs all the android toolchains required.
Once that is all installed you can then run make android
.
The scripts in this repo are not fully standardised yet, there are for example some steps where a fixed path is used, and if your repo is not in that path it will error. These are updates that we need to make so anyone can easily run it.
Also refer to https://github.com/StackmateNetwork/stackmate-core/blob/main/docs/build01.md to better understand the process of cross compilation specifically for android.
The init.sh script is a headless install of android toolchain (without android studio)
The build01.md recommends using Android Studio.
You can go either route, just make sure you have the correct path which will usually be something like
$HOME/Android/Sdk/ndk/
or android in lowercase.
Hey @i5hi, I was able to build this for android as well. For some reason though, It doesn't work with ndk 25 but got this working with ndk 22. Thanks for the instructions.
Hey @i5hi On running
make ios
in the parent directory, I'm getting the following error: