Skip to main content
This guide covers building Off Grid from source, including prerequisites, setup, and platform-specific build commands.

Prerequisites

1

Node.js 20+

Off Grid requires Node.js 20 or higher. Install from nodejs.org or use a version manager like nvm.
2

React Native CLI

Install the React Native CLI globally:
3

Platform-Specific Tools

Install the required tools for your target platform:
  • JDK 17 - Java Development Kit (Temurin/Adoptium recommended)
  • Android SDK (API 36) - Install via Android Studio
  • Android NDK r27 - Required for native module compilation
  • Android Studio - Recommended for device emulation and debugging
Verify your setup:

Clone and Install

1

Clone the repository

2

Install JavaScript dependencies

This installs all React Native and JavaScript dependencies defined in package.json.
3

Platform setup

This cleans the Gradle build cache and prepares the Android project.

Development Builds

Start Metro Bundler

First, start the Metro bundler in a terminal:
Leave this running and open a new terminal for platform-specific commands.

Android

This launches the app on a connected Android device or emulator.
Make sure you have a device connected via ADB or an emulator running before executing the build command.

iOS

Always open OffgridMobile.xcworkspace, not OffgridMobile.xcodeproj. The workspace includes CocoaPods dependencies.

Release Builds

Android

1

Create keystore (first time only)

Store the keystore file in a secure location (not in the repository).
2

Configure signing

Create or edit android/gradle.properties:
android/gradle.properties
Never commit gradle.properties with credentials to version control. Add it to .gitignore.
3

Build the release APK

The signed APK will be at:

iOS

1

Open Xcode

2

Archive the build

  1. Select Product → Archive
  2. Wait for the archive to complete
  3. The Organizer window will open automatically
3

Distribute the app

  1. Select your archive
  2. Click Distribute App
  3. Choose distribution method:
    • App Store Connect - For App Store submission
    • Ad Hoc - For TestFlight or direct distribution
    • Development - For local testing
  4. Follow the signing and provisioning workflow

Troubleshooting

Android Build Errors

Clear the Gradle cache and rebuild:
Install the NDK via Android Studio:
  1. Open Tools → SDK Manager
  2. Select SDK Tools tab
  3. Check NDK (Side by side)
  4. Click Apply to install
Edit android/build.gradle and ensure buildToolsVersion matches your installed version:

iOS Build Errors

Clean and reinstall pods:
  1. Open OffgridMobile.xcworkspace in Xcode
  2. Select the project in the navigator
  3. Go to Signing & Capabilities
  4. Select your Team (requires Apple Developer account)
  5. Xcode will automatically manage provisioning profiles
This usually means the device is locked. Unlock your device and try again.

Next Steps

Project Structure

Learn how the codebase is organized

Testing Guide

Run tests and understand the testing strategy

Contributing

Learn the contribution workflow and quality gates