# Android Gradle plugin requires Java 17 to run

> Getting the error “Android Gradle plugin requires Java 17 to run”? Here is how to fix it. The JDK is older than this Capacitor version allows.

**Android Gradle plugin requires Java 17 to run.** The Android Gradle plugin needs a specific JDK, and newer Capacitor versions need a newer Java than the one installed.

- Android build. Wrong Java version for Gradle.
- Interactive page: https://capwr.app/free-tools/build-error-explainer/android-gradle-plugin-requires-java
- Build error explainer: https://capwr.app/free-tools/build-error-explainer
- Last updated: 2026-10-03

## What this error means

The Android Gradle plugin needs a specific JDK, and newer Capacitor versions need a newer Java than the one installed.

## Why it happens

The Android Gradle plugin refuses to run on a JDK older than the one it was built for. Newer Capacitor versions raise that requirement (JDK 21 from Capacitor 7, JDK 17 for Capacitor 6). The log names the version it wanted.

## The message tools print

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

## How to fix it

1. Use JDK 21 for Capacitor 7 and later, JDK 17 for Capacitor 6.
2. On GitHub Actions, add actions/setup-java with the temurin distribution and that java-version.
3. Locally, point Android Studio’s Gradle JDK at the same version.

## Check a log that shows this

Paste the failing step into the [build error explainer](https://capwr.app/free-tools/build-error-explainer). It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

## Other Android build errors

- [Android SDK location not found](https://capwr.app/free-tools/build-error-explainer/android-sdk-location-not-found)
- [:capacitor-android project could not be found](https://capwr.app/free-tools/build-error-explainer/capacitor-android-project-could-not-be-found)
- [Android resource linking failed](https://capwr.app/free-tools/build-error-explainer/android-resource-linking-failed)
- [Keystore was tampered with, or password was incorrect](https://capwr.app/free-tools/build-error-explainer/keystore-was-tampered-with-or-password-incorrect)
- [Duplicate class found in modules](https://capwr.app/free-tools/build-error-explainer/duplicate-class-found-in-modules)
- [Could not resolve all files for configuration](https://capwr.app/free-tools/build-error-explainer/could-not-resolve-gradle-configuration)

## Let the Android build run in CI

CapWrapp builds the release on GitHub Actions with the JDK and Android SDK the project needs, and signs it with the upload keystore it stores for you.

[Get started free](https://capwr.app/login).

## About CapWrapp

CapWrapp turns a web app on GitHub — built with Lovable, Bolt, Base44, Cursor or by hand — into iPhone and Android apps. It adds Capacitor if the repo needs it, signs the builds, and ships them to TestFlight and Google Play from GitHub Actions, with no Mac or Xcode on your side. [Get started free](https://capwr.app/login) · [Lovable to App Store guide](https://capwr.app/guides/lovable-to-app-store)
