This is only needed if you wish to use a version of the Android NDK higher than version 22 with versions of Rust that are lower than version 1.68. This guide details how to prevent the unable to find library -lgcc error.
Install the latest NDK:
Android Studio > SDK Manager > SDK Tools > NDK (Side by side)
Click on OK at the bottom right corner to start the installation.
You should install
cargo-ndk version 2.7.0 or above which works for
Android NDK versions greater than 22.
cargo install cargo-ndk --version ^2.7.0
A workaround may be under development in the cargo-ndk project. Until it is finished, you need to manually create four text files to redirect calls from libgcc to libunwind (reference):
Find out all the 4 folders containing file
On Windows, it is similar to:
On macOS Monterey, it is similar to:
The three other folders end with
Create 4 text files named
libgcc.ain the four folders mentioned above with these contents
For more details on how NDK works with
flutter_rust_bridge, have a look at this article please.