Skip to content

Latest commit

 

History

History
140 lines (93 loc) · 3.69 KB

README.md

File metadata and controls

140 lines (93 loc) · 3.69 KB

📱 FieldKit Mobile App

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.

screenshot of app

Table of Contents

🛠 Prerequisites

Before you get started, ensure you have the following installed:

Android-Specific Dependencies:

echo "ANDROID_NDK=path/to/ndk" >> ~/.gradle/gradle.properties

📦 Setup and Dependencies

.env

You will need to copy env.template to .env

RustFK

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.

  1. Clone the Repository:
git clone https://github.com/fieldkit/rustfk
  1. Integrate your Rust code: Edit api.rs as needed. Afterwards, get the "just" task runner:
cargo install just
  1. Generate Bridge Files: First, ensure the codegen tool's version matches flutter_rust_bridge in pubspec.yaml and flutter_rust_bridge & flutter_rust_bridge_macros inside native/Cargo.toml.
cargo install -f --version 2.0.0-dev.28 flutter_rust_bridge_codegen
  1. Run gen

just gen

🔧 Tip: Whenever you adjust the version in pubspec.yaml, ensure to run flutter 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

🍏 iOS Troubleshooting

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

🏃 Running the Code

Run the Flutter application with:

flutter run

Errors about libffi architecture

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

Errors about #import <FlutterMacOS/FlutterMacOS.h>

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.

🧪 Running the Tests

Test the Flutter application with:

flutter test