◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SDK 58 — Beta since 09/15 with no stable date yet; running projects in Expo Go has required login since 09/03●WIDGET — A write-up traces an iOS widget that renders black only in production builds●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
Articles/App Dev
◇ App Dev/2026-04-09Intermediate

Fix Rork Android Build Errors: Gradle & SDK Troubleshooting Guide

Struggling with Android build errors in your Rork app? This guide covers the most common Gradle errors, SDK version mismatches, and memory issues — with step-by-step solutions for each.

troubleshooting69error6fix6Android55GradleSDKbuild error4

If you've hit a BUILD FAILED message while trying to compile your Rork app for Android, you're not alone. Gradle errors and Android SDK version mismatches are among the most frequently reported issues in Rork-generated React Native / Expo projects. The error messages can be long, cryptic, and frustrating — but most of them have a clear root cause and a straightforward fix.

This guide walks through the five most common Android build errors in Rork apps, explains why each one happens, and gives you concrete steps to resolve them.

Common Android Build Error Patterns

Here are the error categories we'll cover:

  • Gradle build script errors (BUILD FAILED, Could not resolve)
  • Android SDK / Build Tools version mismatch (compileSdkVersion issues)
  • minSdkVersion conflicts (library requirements higher than your app's setting)
  • Gradle Daemon crashes / out of memory (OutOfMemoryError)
  • Kotlin / Java version incompatibility (Unsupported class file major version)

Error #1: Gradle Build Script Failures

What You'll See

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Could not resolve com.android.tools.build:gradle:8.3.0.

Or:

A problem occurred configuring root project 'RorkApp'.
> Could not resolve all files for configuration ':classpath'.

Why It Happens

There are three common causes:

  • Network issues: Gradle can't download dependencies from Maven repositories
  • AGP / Gradle version mismatch: The Android Gradle Plugin (AGP) version in android/build.gradle doesn't align with the Gradle wrapper version
  • Corrupted local cache: An incomplete or corrupted Gradle cache from a previous failed build

How to Fix It

Step 1: Clean the Gradle cache

# Run from the project root
cd android
./gradlew clean
 
# If that doesn't work, delete the entire local cache
rm -rf ~/.gradle/caches/

Step 2: Check the Gradle wrapper version

Open android/gradle/wrapper/gradle-wrapper.properties and verify the distributionUrl:

# android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

Then check your AGP version in android/build.gradle:

// android/build.gradle
buildscript {
    dependencies {
        // AGP 8.3 requires Gradle 8.3+
        classpath("com.android.tools.build:gradle:8.3.0")
    }
}

Refer to the official AGP / Gradle version compatibility table to match the correct versions.

Step 3: Verify your repository configuration

Make sure google() and mavenCentral() are both present in android/settings.gradle:

// android/settings.gradle (new format)
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

Error #2: Android SDK / Build Tools Version Mismatch

What You'll See

Android Gradle plugin requires Java 17 to run. You are currently using Java 11.

Or:

compileSdkVersion 33 is too old. Please update to compileSdkVersion 34 or higher.

Why It Happens

Rork-generated apps track the latest Expo SDK, which periodically updates its recommended Android SDK target. If your local Android Studio installation is out of date, or if your build.gradle settings haven't been updated, these mismatches occur.

How to Fix It

Step 1: Update the Android SDK in Android Studio

Open Settings > Appearance & Behavior > System Settings > Android SDK and ensure these are installed:

Android SDK Platform:
  ✅ Android 14 (API 34) — recommended
  ✅ Android 13 (API 33) — for compatibility testing

Android SDK Build-Tools:
  ✅ 34.0.0 (latest)

Android SDK Command-line Tools:
  ✅ Latest

Step 2: Update compileSdkVersion in app/build.gradle

// android/app/build.gradle
android {
    compileSdkVersion 34          // ← update to latest
    buildToolsVersion "34.0.0"    // ← keep in sync
 
    defaultConfig {
        minSdkVersion 24          // Rork recommended minimum
        targetSdkVersion 34       // ← update to latest
    }
}

Step 3: Switch the JVM target to Java 17

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = "17"
    }
}

Error #3: minSdkVersion Conflict

What You'll See

Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 24
declared in library [com.example.library:1.0.0]

Why It Happens

A library in your Rork app requires a higher minSdkVersion than what's set in your app/build.gradle. This is common when adding camera, biometric, or AI-powered native features.

How to Fix It

Step 1: Identify the required version from the error message

The error will name the library and the version it requires. Note that value.

Step 2: Raise your minSdkVersion

android {
    defaultConfig {
        // Raise from 21 to 24 (Rork's current recommendation)
        minSdkVersion 24
    }
}

Step 3: Check the impact

Raising minSdkVersion to 24 drops support for Android 5 and 6. API 24+ (Android 7.0+) covers over 99% of active Android devices today, so this change has minimal real-world impact. You can verify the exact coverage using the Device Coverage chart in Google Play Console before making the change.

For a full guide to publishing your Rork app on Google Play, see Publishing Your Rork App on Google Play.

Error #4: Gradle Daemon Crash / Out of Memory

What You'll See

Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

Or:

java.lang.OutOfMemoryError: Java heap space

Why It Happens

The Gradle daemon process doesn't have enough heap memory to complete the build. This is especially common in larger Rork apps that bundle multiple native modules and libraries.

How to Fix It

Step 1: Increase JVM heap size in gradle.properties

# android/gradle.properties
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true

Step 2: Restart the Gradle Daemon

cd android
./gradlew --stop      # stop the running daemon
./gradlew clean build # start fresh

Step 3: Disable parallel builds as a temporary workaround

On memory-constrained machines, disabling parallel builds can help:

# android/gradle.properties
org.gradle.parallel=false

Error #5: Kotlin / Java Version Incompatibility

What You'll See

error: class file has wrong version 61.0, should be 55.0
Unsupported class file major version 61

Or:

'compileReleaseJavaWithJavac' task (current target is 1.8) and 'compileReleaseKotlin'
task (current target is 17) jvm target compatibility should be set to the same Java version

Why It Happens

The Kotlin compiler and Java compiler are targeting different JVM bytecode versions. Rork apps use Kotlin 1.9+ which requires JVM 17 alignment.

How to Fix It

Step 1: Align the JVM target for both Kotlin and Java

// android/app/build.gradle
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = "17"  // must match the Java target
    }
}

Step 2: Update the Kotlin Gradle plugin version

// android/build.gradle
buildscript {
    ext {
        kotlinVersion = "2.0.0"  // latest stable
    }
    dependencies {
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
    }
}

Verifying Your Fix

After applying a fix, always verify with a clean build:

# Clean and rebuild
cd android && ./gradlew clean
 
# Run a debug build
./gradlew assembleDebug
 
# Success looks like:
# BUILD SUCCESSFUL in Xs

You can also use Rork Companion or Expo Go to do a quick preview alongside your local debug build for a complete sanity check.

Prevention: Best Practices to Avoid Future Build Errors

Keep SDK versions in sync with Expo SDK upgrades: When Rork or Expo pushes an SDK update, check whether compileSdkVersion and targetSdkVersion also need to be bumped.

Pin the Gradle wrapper version: Use a specific version in gradle-wrapper.properties to avoid unexpected upgrades.

# Explicitly pin a stable version
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

Automate build checks with CI/CD: A simple GitHub Actions workflow can catch Android build failures before they reach you locally.

# .github/workflows/android-build.yml (example)
- name: Build Android Debug APK
  run: |
    cd android
    ./gradlew assembleDebug

Save detailed build logs when errors occur:

./gradlew assembleDebug --info > build_log.txt 2>&1

Having logs from both a working and a broken build makes debugging much faster.

For Expo-specific dependency errors, check out the Rork Expo Dependency Error Fix Guide as well.

Looking back

Android Gradle and SDK errors in Rork apps almost always come down to version mismatches, stale caches, or insufficient memory. With the five patterns and solutions in this guide, you have a reliable playbook to diagnose and fix the most common issues.

For broader React Native and Expo build errors, the Rork React Native Build Error Complete Guide 2026 is a great companion resource.

Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◇ App Dev2026-10-15
When Only EAS Build Fails with "No matching variant", Check Your Local android/build First
Gradle passes on your machine, but the Android build on EAS stops at "No matching variant of project". Reading the reports on GitHub, I traced how a Windows-generated autolinking cache can reach the Linux builder, and wrote a small script that checks for it before you queue a build.
◇ App Dev2026-10-15
When adjustsFontSizeToFit Shrinks Just One Row, Suspect the Box Height, Not the String
Only the 10th row of a list drops to 4pt on iOS, though the data and strings are fine. I read the Yoga rounding and font-fit sources, then counted how often the box comes up short in Node.
◇ App Dev2026-10-14
App Review Says "Guideline 2.1, Blank Screen": Three Places to Look in an Expo Release Build
It opens fine in TestFlight, yet review rejects it for a blank screen. Here is the order I check things in an Expo + EAS release build: which environment holds your variables, secret visibility during config resolution, and what the reviewer's device does differently.