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 (
compileSdkVersionissues) - 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.gradledoesn'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.zipThen 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=trueStep 2: Restart the Gradle Daemon
cd android
./gradlew --stop # stop the running daemon
./gradlew clean build # start freshStep 3: Disable parallel builds as a temporary workaround
On memory-constrained machines, disabling parallel builds can help:
# android/gradle.properties
org.gradle.parallel=falseError #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 XsYou 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.zipAutomate 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 assembleDebugSave detailed build logs when errors occur:
./gradlew assembleDebug --info > build_log.txt 2>&1Having 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.