Question #145EasyNative Integration

What is Gradle wrapper to version 8.11.1 in android/gradle/wrapper/gradle-wrapper.properties

#android

Answer

Overview

The Gradle Wrapper is a script (

text
gradlew
) that automatically downloads and uses a specific version of Gradle for your project — ensuring consistent builds across different machines without requiring Gradle to be installed globally.


What is gradle-wrapper.properties?

Located at

text
android/gradle/wrapper/gradle-wrapper.properties
, this file specifies which Gradle version the wrapper should download and use.

properties
# android/gradle/wrapper/gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip

Updating to Gradle 8.11.1

properties
# Change the distributionUrl to the new version
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip

Or via terminal:

bash
cd android
./gradlew wrapper --gradle-version 8.11.1

Why Update Gradle?

ReasonDetail
New AGP requirementsAndroid Gradle Plugin 8.x requires Gradle 8.x
Kotlin compatibilityNewer Kotlin versions need newer Gradle
text
    | **Performance** | Gradle 8.x has improved build caching and configuration cache |

| Bug fixes | Fixes for existing build issues | | Android 15 support | Required for API 35 target |


Compatibility Matrix

AGP VersionMin Gradle Version
8.9.x8.11.1
8.7.x8.9
8.4.x8.6
8.2.x8.2

Flutter Project Full Setup (android/gradle/wrapper/gradle-wrapper.properties)

properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true

Common Issues After Gradle Update

bash
# If build fails after updating, sync and rebuild
flutter clean
flutter pub get
cd android && ./gradlew clean
flutter run

Key Point: The Gradle Wrapper downloads the specified Gradle version automatically on first build. You commit

text
gradle-wrapper.properties
to source control so all team members use the exact same Gradle version, ensuring consistent builds.