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

前端 未结 8 1318
北荒
北荒 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条回答
  •  旧时难觅i
    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 /platforms/android/gradle/ and update env variable:

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

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

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

    This worked for me.

提交回复
热议问题