When I try to build the Project 1, I get the following error. It seems that both gradle-3.0.0-beta6 and gradle-3.0.0-beta9 are unavailable.
Where can I find latest gradle version in android studio? Could you tell me a URL which can list all available gradle versions?
Error:Could not find com.android.tools.build:gradle:3.0.0-beta6.
Searched in the following locations:
file:/E:/Android_Studio_3.1/gradle/m2repository/com/android/tools/build/gradle/3.0.0-beta6/gradle-3.0.0-beta6.pom
file:/E:/Android_Studio_3.1/gradle/m2repository/com/android/tools/build/gradle/3.0.0-beta6/gradle-3.0.0-beta6.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta6/gradle-3.0.0-beta6.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-beta6/gradle-3.0.0-beta6.jar
Project 1
buildscript {
ext.support_version = '26.0.0'
ext.kotlin_version = '1.1.4-3'
ext.anko_version = '0.10.1'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:gradle-3.0.0-beta6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.
The current Gradle release is version 7.5.1, released on 05 Aug 2022. The distribution zip file comes in two flavors: Binary-only. Complete, with docs and sources.
The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
Use + sign instead of version no. It will automatically picks the latest one available
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
See here for release/version information of gradle android plugin: https://bintray.com/android/android-tools/com.android.tools.build.gradle/view
But if you want to install a specific version.Check the url below.
https://services.gradle.org/distributions/
Here you can found the one you required. FYI beta versions are not available.
Inside your Android Studio's project tree, open the file gradle/wrapper/gradle-wrapper.properties. Change this entry to the one you need:
distributionUrl=http://services.gradle.org/distributions/gradle-2.1-all.zip
As per official documents : You should not use dynamic dependencies in version numbers, such as 'com.android.tools.build:gradle:2.+'. Using this feature can cause unexpected version updates and difficulty resolving version differences.
If the specified plugin version has not been downloaded, Gradle downloads it the next time you build your project or click Tools > Android > Sync Project with Gradle Files from the Android Studio menu bar.
Update Gradle
When you update Android Studio, you may receive a prompt to also update Gradle to the latest available version. You can choose to accept the update or manually specify a version based on your project's build requirements.
The following table lists which version of Gradle is required for each version of the Android plugin for Gradle. For the best performance, you should use the latest possible version of both Gradle and the Android plugin.
Plugin version Required Gradle version
1.0.0 - 1.1.3 2.2.1 - 2.3
1.2.0 - 1.3.1 2.2.1 - 2.9
1.5.0 2.2.1 - 2.13
2.0.0 - 2.1.2 2.10 - 2.13
2.1.3 - 2.2.3 2.14.1+
2.3.0+ 3.3+
For More information Click here
This error is for Android Plugin Version for gradle, not Gradle Version!
You can find all gradle release versions at its github release page( Read Upgrade Instructions section)
You should set gradle version in gradle-wrapper.properties
file:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
Or from Android Studio: file>Project Structure>Project>gradle version
But Android plugin version for gradle depends on Android Studio & Gradle version and Android Studio prompt you to update it ( if you open an old project or if you update your android studio)
You can find its version at Android Plugin for Gradle Release Notes
You can specify the Android plugin for Gradle version in either the File > Project Structure > Project menu in Android Studio, or the top-level build.gradle file. The following example sets the Android plugin for Gradle to version 2.3.3 from the build.gradle file:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With