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

前端 未结 8 1317
北荒
北荒 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:33

    I'd love to just leave this as a comment, but I'm apparently not reputable enough...

    After reading your documentation, I wasn't able to resolve my issue with your suggestion of keeping the Android Studio to "Use default gradle wrapper". What I did find is that setting the session variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL before building got me a bit further:

    root@dev:$ export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https\://services.gradle.org/distributions/gradle-2.14.1-all.zip"
    root@dev:$ cordova build android
    

    The next thing I had to do was edit /platforms/android/build.gradle and /platforms/android/CordovaLib/build.gradle and make sure they both pointed to a valid gradle plugin version.

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

    ...and in /platforms/android/CordovaLib/build.gradle I added jcenter in the repositories (because maven.org did not seem to have 2.2.0)

    repositories {
        mavenCentral();
        jcenter()
    }
    

    I was able to build then.

提交回复
热议问题