Cordova / Ionic build android Gradle error: Minimum supported Gradle version is 2.14.1. Current version is 2.13

前端 未结 8 1293
北荒
北荒 2021-02-02 07:34

This is a solution to the above error that I want to document. I found other similar posts, but none described how this error can be associated with Cordova or Ionic.

I

相关标签:
8条回答
  • 2021-02-02 08:36

    For follow error:

    Minimum supported Gradle version is 4.1. Current version is 3.3. If using t he gradle wrapper, try editing the distributionUrl in E:\ionic\MyIonicProject\gr adle\wrapper\gradle-wrapper.properties to gradle-4.1-all.zip for gradle 4.1

    This command worked for me:

    ionic cordova platform update android
    
    0 讨论(0)
  • 2021-02-02 08:37

    I want to extend @bungler answer.

    I got confused with version of gradle & compatible version of android plugin for gradle. Following link has the list of compatibale versions mapping:

    Gradle vs Android plugin for gradle - Compatible version list

    For current version of gradle 3.3+, compatible version of android plugin is 2.3.3

    So final settings will look like following:

    For Mac

    STEP 1: Add following in env variables:

    option a) update env variable:

    export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https\://services.gradle.org/distributions/gradle-3.3-all.zip"
    

    or

    option b ) you can download the gradle file and place it in <project>/platforms/android/gradle/ and update env variable:

    export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="../gradle-3.3-all.zip"
    

    STEP 2: Update following in <project>/platforms/android/CordovaLib/build.gradle

    buildscript {
      ...
      dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
      }
    }
    

    This worked for me.

    0 讨论(0)
提交回复
热议问题