Stay ahead in the field with FieldKit mobile app. Here's everything you need to get started to build the fieldkit app.
This version is for contributors or developers, to download the Android app or the iOS app.
Before you get started, ensure you have the following installed:
- Flutter SDK: Installation Guide
- Rust Language: Get Rustup
- Rust Targets: For cross-compiling to your device. Read More
- cargo-ndk: Installation Instructions
- Android NDK 22: After installation, set its path using:
echo "ANDROID_NDK=path/to/ndk" >> ~/.gradle/gradle.properties
You will need to copy env.template
to .env
By default, rustfk
will be downloaded from git when building the native rust
library for the application.
If you're going to be making changes to the rust side of the application, it's
handy to develop against a local working copy of the rustfk
library.
For most development you can build against the default git revision and no local copy is necessary.
- Clone the Repository:
git clone https://github.com/fieldkit/rustfk
- Integrate your Rust code: Edit
api.rs
as needed. Afterwards, get the "just" task runner:
cargo install just
- Generate Bridge Files:
First, ensure the codegen tool's version matches
flutter_rust_bridge
inpubspec.yaml
andflutter_rust_bridge
&flutter_rust_bridge_macros
insidenative/Cargo.toml
.
cargo install -f --version 2.0.0-dev.28 flutter_rust_bridge_codegen
- Run gen
just gen
🔧 Tip: Whenever you adjust the version in
pubspec.yaml
, ensure to runflutter clean
. 🔧 Tip2: If running on Linux, run the following command before all else.sudo apt-get install build-essential libssl-dev pkg-config libsqlite3-dev
Facing build issues with iOS? Try the following:
- Licensing issues:
xcodebuild -license
- Missing iOS platforms:
xcodebuild -downloadPlatform iOS
- Installing simulators:
xcodebuild -runFirstLaunch
OR
xcodebuild -downloadAllPlatforms
Run the Flutter application with:
flutter run
First of all, I'm so sorry this is happening to you because this was one of the most frustrating errors I've ever gotten. There's a clue in the build log, though, which is rare. It suggests this:
sudo gem uninstall ffi && sudo arch -x86_64 gem install ffi -- --enable-libffi-alloc
Somehwat related, if you find you get the opposite error, you may need to specify the architecture then as well, for example:
arch -x86_64 pod repo update
This is usually the MACOS_DEPLOYMENT_TARGET
and friends.
Double check the post_install
step of the Podfile
and be sure that
flutter_additional_macos_build_settings
is being called, or
flutter_additional_ios_build_settings
for iOS
.
Test the Flutter application with:
flutter test