Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio gradle build failed with update

I recently updated android studio to version 3.2. When I tried running my old project, I got the following message for my old project while running grade build:

"The Android Gradle plugin supports only Kotlin Gradle plugin version 1.2.51 and higher.

Project '4thtry' is using version 1.2.50." How to rectify it?

like image 208
Rohit Singh Avatar asked Sep 30 '18 14:09

Rohit Singh


People also ask

Why is my Gradle build failing?

If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.

How do I fix Gradle issues?

For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project click on the Sync Project with Gradle files option. This will automatically download the new Gradle files and will fix the issue which is caused by the Gradle files.

What version of Gradle should I use with Android Studio?

For the best performance, you should use the latest possible version of both Gradle and the plugin. When you update Android Studio, you may receive a prompt to automatically update the Android Gradle plugin to the latest available version. You can choose to accept the update or manually specify a version based on your project’s build requirements.

Why is my Gradle version not up-to-date?

The Android Studio uses Gradle to help add features to the Android apps. It is advised to keep the Gradle version up-to-date and compatible in tandem with the Android Studio. If your Gradle version is not updated you might also get the below error – Generating signed Bundle requires you to update the Android Gradle plugin to version x.y.z or higher

Why does Android Studio say Gradle project sync failed?

Some of the Gradle files may get deleted unexpectedly. So when you will start building your apps you will get to see an error in Android studio as ‘ Error running android: Gradle project sync failed. In this article, we will take a look at 3 different methods for solving this issue.

Why is my Android Gradle plugin not generating a BR file?

Sorry, something went wrong. This is caused by upgrading to Android gradle plugin 2.3 (com.android.tools.build:gradle:2.3.0). In previous versions of the plugin the databinding package name (where the BR file is generated) was provided on an annotation in a generate file.


1 Answers

Go to your root Build.gradle and update the Kotlin.

(Better idea): Add the latest version: ext.kotlin_version = '1.2.71' (or above of 1.2.50) instead of 1.2.50 then rebuild the project.

So we'll have;

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
..
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
...
}
like image 102
ʍѳђઽ૯ท Avatar answered Oct 15 '22 06:10

ʍѳђઽ૯ท