Gradle DSL method not found: 'deleteAllActions()' - android

I cloned this project from github and imported it using android studio but after doing all the rounds I'm getting this error
ERROR: Gradle DSL method not found: 'deleteAllActions()'
Can anyone help me remove this error and build the project well?

You should update the version of the Retrolambda plugin. Currently, that would be 3.7.1.
So in your project's build.gradle file, make sure that you have this line:
classpath 'me.tatarka:gradle-retrolambda:3.7.1'

if you are using below dependency for multiple image selection functionality.
react-native-multiple-image-picker
then remove the below line from build.gradle of the same library.
apply plugin: 'me.tatarka.retrolambda'

If you're trying to open the project on Android Studio 3.4.x, then update your android studio to 3.5.1 and re-clone the same project. I had the same issue and after updating, it built the project successfully!
Edit: This is happening specifically when gradle is updated to 5.4.1
To stop this from happening, change this line inbuild.gradle file :
classpath 'com.android.tools.build:gradle:3.5.1'
To this :
classpath 'com.android.tools.build:gradle:2.2.2'
And change this line in gradle-wrapper.properties :
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
To this :
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
Then sync and it will successfully sync the project

Remove dependency me.tatarka:gradle-retrolambda from build.gradle in data module.

Related

Android studio showing error,gradle file,please find the solution,it shwing some find of error

When I sync my project in Android Studio, I got this error
ERROR: Cause: https://downloads.gradle-dn.com/distributions/gradle-3.4.2-all.zip
I think you have added wrong dependency package.
So Go to gradle > wrapper > gradle-wrapper.properties and checkout your "distributionUrl" has the correct value or not.
You have added a wrong package gradle-3.4.2-all.zip. try changing it to gradle-4.10.2-all.zip
I hope this helps.
Don't confuse gradle with the Android Gradle plugin.
classpath 'com.android.tools.build:gradle:3.4.2'
It is the Android Gradle plugin.
Check the release notes for other versions.
The gradle version is defined in gradle/wrapper/gradle-wrapper.properties.
Use:
distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

DataBinding not working after Upgrade Android Studio 2.3

DataBinding worked very well in my project, But after upgrade Android Studio 2.3 today . Run 'app' failed because following error :
Error:(15, 40) Error: package com.javan.myrecorder.databinding not exist.
import com.javan.myrecorder.databinding.FragmentEventsBinding;
:app:compileMockDebugJavaWithJavac FAILED
I just upgrade android studio and didn't change anything. all plugin is latest! Now my question is, why occurs this error and how could I solve it? any help is welcome!
English is not my mother tongue; please excuse any errors on my part.
EDIT1
Like android project googlesamples/android-architecture
git checkout todo-databinding
and then run ./gradlew assembleDebug to build, build failed because of following error:
complete log of build
EDIT2 I have fixed this problem by following Data Binding broke after upgrade to Gradle 2.3.
in build.gradle(app) add
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
..balabala
dependencies {
apt 'com.android.databinding:compiler:2.3.0'
}
some file in my project:
gradle-wrapper.properties
#Mon Mar 06 10:59:04 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#petrnohejl #George Mount #Sa-Zad Prasla, Thanks!
android-apt and hence using apt has been deprecated since Android Studio 2.2.
Following the android-apt migration guide, instead add the following to your build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
annotationProcessor 'com.android.databinding:compiler:2.3.0'
}
If you are using Kolin, instead use:
apply plugin: 'kotlin-kapt'
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
kapt 'com.android.databinding:compiler:2.3.0'
}
The problem comes in a warning that is difficult to see amongst all of the errors:
Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
If you remove apt, data binding works.
I have also faced the same issue.
I was using ButterKnife and Dagger!!
Solved as follow
1) Remove from app level gradle file:
apply plugin: 'android-apt'
or apply plugin: 'com.neenbedankt.android-apt'
2) Remove from project level gradle file:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
3) And simply change "apt to annotationProcessor" as following dependencies:
apt 'com.jakewharton:butterknife-compiler:8.5.1',
apt "com.google.dagger:dagger-compiler:2.5"
To:
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1',
annotationProcessor "com.google.dagger:dagger-compiler:2.5"
Data binding also broke for us following the update to Android Studio v2.3. The GoLang Bind plugin became unable to generate library .aar files
Our problem was resolved via a combination of GoMobile version "+eb90329 Mar 7 2017" update and GoBind plugin revert to version "0.2.6" (although the current version is "0.2.8")
Update GoMobile:
$ go get -u -x golang.org/x/mobile/cmd/gomobile
$ gomobile init -x
Revert GoBind plugin in build.gradle:
plugins {
id "org.golang.mobile.bind" version "0.2.6"
}
This solution is working on systems with go version 1.7.1 and 1.8 as well as Android Studio versions 2.1.2, 2.2.3, and 2.3.
Two things
Revert back your gradel-wrapper.properties distributionUrl to "https://services.gradle.org/distributions/gradle-2.14.1-all.zip"
Change the gradle version classpath to previous version "'com.android.tools.build:gradle:2.2.3'"
P.S. Instant run will stop working on ADT with older gradle version.
I too recently downloaded the latest version of android studio 2.3.3, because I was getting the same error in version 2.2.3 i.e Error:Failed to resolve: com.android.databinding:compiler:2.2.3 ,even in the latest version, I was getting the same error,I checked the project structure, In the File>Project Structure>Project , the Android Plugin version was still 2.2.3, I changed it to 2.3.3 and the build is successful and everything is working smoothly.
I solved this problem by changing my version of gradle to:
classpath 'com.android.tools.build:gradle:3.0.1'
Since I am using Android Studio 3.0.1

Android: How to update build.gradle?

I need gradle ver 2.1.4 so I tried changing
classpath 'com.android.tools.build:gradle:2.1.3'
to
classpath 'com.android.tools.build:gradle:2.1.4'
but it didn't work. I also tried this method http://devdeeds.com/update-gradle-plugin-android-studio/ but that didn't work either.
This is the error that I am getting
Error:Could not find com.android.tools.build:gradle:2.1.4. Searched in
the following locations:
file:/C:/Users/Reimu/Downloads/android-studio-ide-145.3200535-windows/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.pom
file:/C:/Users/Reimu/Downloads/android-studio-ide-145.3200535-windows/android-studio/gradle/m2repository/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.4/gradle-2.1.4.jar
Required by:
:MyApp:unspecified
I can't run any projects without this being updated apparently.
Any help is appreciated
The classpath 'com.android.tools.build:gradle:2.1.3' is not for Gradle itself, but the Gradle Android build plugin that you apply with the apply plugin: 'com.android.application' or apply plugin: 'com.android.library' in your module's build.gradle file.
If you want to use another version of gradle in your project, reconfigure your gradle wrapper. Search for the /gradle/wrapper/gradle-wrapper.properties file in your project root, and apply the correct distributionUrl, for example:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
For the 2.14.1 version of gradle. This is probably what you need, because there is no such thing as Gradle v. 2.1.4. There is also no Android Gradle plugin v. 2.1.4.
And if it turns out, that you need the newest android grade build plugin, then change your class path to 'com.android.tools.build:gradle:2.2.0-beta2'. Version 2.1.3 is currently the newest stable version.

Can not add com.github.dcendents.android-maven

I tried to upload my code to bintry so that I can connect it to jcenter but the problem occurs when I add this line to my library build.gradle:
apply plugin: 'com.github.dcendents.android-maven'
gradle can not be build, what did I wrong?
I had the same issue. I was using gradle 2.4.
I don't know why but by downgrading gradle to 2.2.1 it get solved.
Just go to File then Project Settings and write in gradle field 2.2.1.

Fix Plugin Version and Sync Project

I have recently updated my Android Studio.
After updating it, When I am trying to import or open a project it gives me following error :
Gradle Sync Issue
Error:Error:Gradle 2.4 requires Android Gradle plugin 1.2.0 (or newer) but project is using version 1.1.0.
Please use Android Gradle plugin 1.2.0 or newer.
Fix plugin version and sync project
Is there any solution for this problem ?
In your build.gradle you should use a newer version of the gradle plugin.
Use classpath 'com.android.tools.build:gradle:1.3.1'instead of classpath 'com.android.tools.build:gradle:1.1.0'. Or at least 1.2.0, as the error points out.
change in your progect build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
As Android Studio was just officially updated to 1.3 (Gradle as well).
Please Change gradle version to 1.3.+ in build.gradle . It should now look like this:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.+'
// in the individual module build.gradle files
}
I met this question,too. Modifying dependencies stuff is confuse me. From#Mykaelos answer, For Windows Android Studio, Go into File > Settings > "Build, Execution, Deployment" > "Build Tools" > Gradle and change it to "Use default gradle wrapper (recommended)", I tried it in early hours, and it works for me.

Categories

Resources