In the following subchapters we'll prepare the Rust Code for each example. We will only discuss the changes in the
This is the situation upon which we are basing our starting point.
As usual, create an empty file called
api.rs, at the same level as
Include it as module in
In the next subchapters, we will test individually for each example whether our library can be cross-compiled to the target platforms Android, macOS, and iOS.
This way, we can independently test the correctness of the dependencies in
Cargo.toml, and the paths and the syntax of our Rust Code in
api.rs, regardless of the Flutter build process.
To examine the various targets, you should navigate from playground_app root directory to the rust directory:
Then, within the rust directory, excute the following commands.
If you haven't already, install the
cargo-ndk command using:
cargo install cargo-ndk
I only check the ABI arm64-v8a.
cargo ndk -t arm64-v8a build
cargo build --target aarch64-apple-darwin
cargo build --target aarch64-apple-ios-sim
cargo build --target aarch64-apple-ios