ProKit Flutter - Documentation
ProKit Flutter

Unsupported gradle version

πŸ•’ Estimated Reading: 1 minutes
πŸ“‚ Location: 
Common Errors β†’ Android errors β†’ Unsupported Gradle Version

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

⚠️ What is This Error?

If you encounter the error message:

Unsupported Gradle version 3.x

It means that your current Gradle version is too old and not compatible with the version of Android Studio or the dependencies used in your project.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ› οΈ When Does This Error Occur?

This typically happens when:

  • You’re trying to open or run an older project with a newer version of Android Studio.
  • TheΒ gradle-wrapper.propertiesΒ file in your project is using a very old version (e.g.,Β 3.x.x) of Gradle that is no longer supported.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

βœ… Solution – How to Fix This

Follow these simple steps to solve this issue:

  1. OpenΒ your project inΒ Android Studio.
  2. Navigate to theΒ androidΒ directory within your project’s root directory.
  3. Wait for the project indexing process to complete inΒ Android Studio.
  4. Once indexing is finished, run your application by selecting the Android module in your project and clicking on theΒ β€œRun” button or using the appropriate keyboard shortcut.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ” If the Issue Still Persists

If you’re still facing the same error:

  • Update the Gradle Version Manually
    Open the following file in your project:
    • android/gradle/wrapper/gradle-wrapper.properties
  • Replace the existing Gradle version with a supported version like:
    • distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
  • Also Update the Gradle Plugin Version
    Open this file:
    • android/build.gradle
  • UnderΒ dependencies, update the Gradle plugin to match the new Gradle version:
    • classpath β€˜com.android.tools.build:gradle:7.2.2’

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

πŸ“’ Additional Help

  • If you’re still stuck, try updatingΒ Android StudioΒ to the latest version.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

βœ… That’s it! You’ve now resolved the Unsupported Gradle Version error and can continue working on your Android project smoothly.