Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/satsigner/satsigner/llms.txt

Use this file to discover all available pages before exploring further.

Overview

This guide covers building SatSigner for Android devices and emulators. The build process uses Expo with React Native and requires Android SDK 34, Java JDK 17, and proper environment configuration.

Prerequisites

Required Software

  • Node.js version 22.4.0 or higher
  • Yarn package manager
  • Java JDK 17 (for building) and JDK 8 (for SDK management)
  • Android SDK with build tools version 34.0.0
  • NDK version 25.1.8937393

Install Yarn

If you don’t have Yarn installed:
npm install --global yarn

Android Environment Setup

Install Android Studio which includes all necessary Android development tools:
  1. Download and install Android Studio
  2. Open Android Studio and go to Settings → Appearance & Behavior → System Settings → Android SDK
  3. Install Android SDK 34 (API level 34)
  4. Install Android SDK Build-Tools 34.0.0
  5. Install Android NDK 25.1.8937393

Option 2: Command Line Tools

For developers using other IDEs, install these packages:
  • android-sdk
  • android-sdk-build-tools
  • android-sdk-platform-tools
  • android-tools

Environment Variables

Linux/macOS

Add these environment variables to your shell configuration (~/.bashrc, ~/.zshrc, etc.):
export ANDROID_HOME=/opt/android-sdk
export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator
Note: On macOS, ANDROID_HOME is typically ~/Library/Android/sdk

Using direnv (Optional)

For project-specific environment variables, use direnv:
  1. Install direnv: brew install direnv (macOS) or via your package manager
  2. Create apps/mobile/.envrc with:
    export ANDROID_HOME=/opt/android-sdk
    export PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator
    
  3. Run direnv allow in the directory

Windows

Use Git Bash instead of PowerShell. Create or edit C:\Users\<username>\.bash_profile:
export PATH="/c/Users/<username>/AppData/Local/Android/Sdk/platform-tools:$PATH"
export PATH="/c/Program Files/Java/jdk-17/bin:$PATH"
export ANDROID_HOME="/c/Users/<username>/AppData/Local/Android/Sdk"
Replace <username> with your Windows username.

SDK Configuration

SDK Requirements

  • minSdkVersion: 23
  • compileSdkVersion: 34
  • targetSdkVersion: 34
  • buildToolsVersion: 34.0.0
  • kotlinVersion: 1.8.10
  • ndkVersion: 25.1.8937393
These are configured in apps/mobile/android/build.gradle.

Installing System Images

Step 1: Enable JDK 8

For SDK management, temporarily switch to JDK 8: Arch Linux:
sudo archlinux-java set java-8-openjdk
Other Linux:
sudo update-alternatives --config java
# Select JDK 8

Step 2: List Available Images

sdkmanager --list
Look for images matching your CPU architecture:
  • Intel/AMD: system-images;android-34;default;x86_64
  • Apple Silicon: system-images;android-34;default;arm64-v8a

Step 3: Install System Image

sdkmanager --install 'system-images;android-34;default;x86_64'
Replace with your chosen image name.

Step 4: Create Emulator Device

avdmanager create avd -n myemulator -k 'system-images;android-34;default;x86_64'
Replace myemulator with your desired device name.

Step 5: Switch to JDK 17

Critical: Switch to JDK 17 before building: Arch Linux:
sudo archlinux-java set java-17-openjdk
Other Linux:
sudo update-alternatives --config java
# Select JDK 17
Verify:
java -version
# Should show version 17.x.x

Installation

From the repository root:
# Install dependencies
yarn install

# Navigate to mobile app
cd apps/mobile

Building and Running

Standard Build

Build and run the app on a connected device or emulator:
yarn android
This command:
  1. Compiles the Android project
  2. Installs the development build
  3. Starts the Metro bundler
  4. Launches the app

Alternative: Expo CLI

expx expo run:android

Running on Physical Device

  1. Enable Developer Options on your Android device:
    • Go to Settings → About Phone
    • Tap “Build Number” 7 times
  2. Enable USB Debugging in Developer Options
  3. Connect device via USB
  4. Verify connection: adb devices
  5. Run: yarn android

Troubleshooting

Build Error: [CXX5304]

This error occurs when _JAVA_OPTIONS interferes with the build:
unset _JAVA_OPTIONS
yarn android

Build Fails with Java Version Error

Ensure you’re using JDK 17 for building:
java -version
# Must show 17.x.x
If wrong version, switch to JDK 17 (see Step 5 above).

Metro Bundler Connection Issues

If the app can’t connect to Metro:
adb reverse tcp:8081 tcp:8081

Gradle Build Timeout

Increase Gradle daemon memory:
  1. Create/edit apps/mobile/android/gradle.properties
  2. Add:
    org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    

Clean Build

If experiencing persistent build issues:
cd apps/mobile/android
./gradlew clean
cd ..
yarn android

Emulator Won’t Start

Verify emulator installation:
emulator -list-avds
# Should show your emulator name

emulator -avd myemulator
# Manually start emulator

SDK Location Not Found

Create apps/mobile/android/local.properties:
sdk.dir=/path/to/android/sdk
Replace with your actual ANDROID_HOME path.

Path Issues on Windows

  • Always use Git Bash, not PowerShell or CMD
  • Ensure .bash_profile is in C:\Users\<username>\
  • Restart Git Bash after editing .bash_profile
  • Verify paths: echo $ANDROID_HOME

Build Configuration

Key configuration files:
  • apps/mobile/android/build.gradle - SDK versions and build tools
  • apps/mobile/android/app/build.gradle - App-specific build config
  • apps/mobile/app.json - Expo configuration
  • apps/mobile/package.json - Build scripts

Next Steps

Additional Resources