I've been staying on the beta channel of Android Gradle Plugin for a while now. Periodically an AGP update will also bump the Gradle version in gradle-wrapper.properties.
When this happens is AGP bumping Gradle to the minimum supported version. Or is this the "desired" version that AGP wants to work with?
What happens if I manually bump Gradle past this? For example, right now I'm on AGP 3.4beta5, which has set Gradle to 5.1.1.
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
What happens if I manually set the version to 5.3 or 5.4? https://gradle.org/releases/ Is this generally a good idea?
https://developer.android.com/studio/releases/gradle-plugin#3-4-0. This link suggests that we can use 'Gradle 5.1.1 or higher'.
Related
the google play console advised me to use the debugSymbolLevel option, but it seems that requires a higher gradle plugin version(4.1). Currently my Android Gradle Plugin Version is 3.5.4 and my Gradle Version 5.6.4
I know very little about gradle. Is there any reason i shouldn't just select the highest versions for both? If yes which ones should i use?
Android Gradle Plugin Version offers options up to 7.3.1
Gradle Version upt to '8.0-milestone2'
Since the two versions span a lot, there might be a lot of breaking changes for your project. I suggest you doing some backup, trying to choose a stable version of it (7.x) and running the project. Good luck.
Is there any minimum recommended or required Gradle or Gradle Plugin versions if we intend to target Android 30?
You can have reference to this https://developer.android.com/studio/releases/gradle-plugin
It is always best to use the latest Gradle and AGP, if you're using Beta or Canary distribution, back down one small version if you encounter errors when compiling.
I imported an old project from github to use it in a course, then I received this error message :
Support for builds using Gradle versions older than 2.6 was removed in tooling API version 5.0. You are currently using Gradle version 2.2.1. You should upgrade your Gradle build to use Gradle 2.6 or later.
I suggest you to update your versions to these:
/project/build.gradle
classpath "com.android.tools.build:gradle:4.1.3"
/project/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
in Build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
where as in graddle-wrapper.properties, i have
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip
where these both are different?
Can they cause an error being different in version?
please brief me in details.Thank you.
First of all, both of those versions are extremely outdated. The latest stable version for the ditributionUrl is 4.x. The latest stable for the classpath is 3.3.0.
The difference is this: the distributionUrl is the actual version of the Gradle build system. The classpath is the version of the Android Gradle plugin, not Gradle itself.
The versions you have tell me that you're either using an outdated version of Android Studio, or you ignored the popups telling you a newer version of Gradle was required for the newer version of Android Studio. You should probably update Android Studio to 3.3.
I successfully upgrade gradle from 2.10 to 3.5 to build APK in android studio 3, but have problem like this
And this is my build gradle
If you are going to update gradle version specially 3.1+ than you might need to upgrade support lib version too. its weird but it seems compatibility issues between gradle version and support lib version.