question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cordova's configured gradle version unsupported in Android Studio 3.4

See original GitHub issue

Bug Report

Android Studio 3.4 (just released) require a minimum Gradle version of 5.1.1, and so Gradle sync fails:

> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 5.1.1. Current version is 4.10.3. If using the gradle wrapper, try editing the distributionUrl in /Users/jacob/workspace/f-tc/src-cordova/platforms/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.1.1-all.zip

Problem

See above

What is expected to happen?

cordova android automatically configured for Gradle 5.1.

What does actually happen?

uses Gradle 4.10

Information

Command or Code

Environment, Platform, Device

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
codinronancommented, Apr 20, 2019

Hmmm I am using Gradle 5.1 in Android Studio 3.4 without any issues.

However I should note that when I am provided the opportunity to upgrade the Gradle plugin, I do so - the first time Android Studio is opened after doing cordova prepare. If you do not take that opportunity, for some reason if you do it later the upgrade doesn’t occur correctly and I get other errors and end up having to start over.

The useDeprecatedNdk setting in gradle.properties is also no longer accepted, NDK is removed in Android Studio 3.4, I end up needing to manually edit gradle.properties to remove it.

Getting cordova-android 8.1 released would be incredibly helpful, the build conflicts are mounting up.

1reaction
benitogfcommented, Jul 11, 2019

I faced a similar issue and was able to solve it updating cordova:

npm i -g cordova

then removing and adding back the android platform:

cordova platform remove android
cordova plarform add android

And finally adding the minSdk preference to config.xml:

<preference name="android-minSdkVersion" value="19"/>

but now I get a different error on graddle sync inside android studio:

The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Minimum supported Gradle version is 3.3. Current version is ...
For example, Android Gradle Plugin version 3.1.0+ requires a minimal gradle version 4.4. You can be configured via Android Studio File -> ...
Read more >
Android Gradle plugin release notes - Android Developers
The Android Studio build system is based on Gradle, and the Android Gradle plugin adds several features that are specific to building Android...
Read more >
Android Platform Guide - Apache Cordova
As a general rule, Android versions become unsupported by Cordova as they dip ... It is possible to configure the Gradle build by...
Read more >
Gradle version support - Wappler Community
cordova's configured gradle version unsupported in Android Studio 3.4. opened 10:37PM - 19 Apr 19 UTC. closed 10:24AM - 21 Jan 20 UTC....
Read more >
Android SDK and Emulator
To download and install Android Studio, click Google Android Studio. ... Change com.android.tools.build:gradle version to 3.4.0-beta03 in the build.gradle ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found