Gradle error after updating to Android Studio 2.3

可紊 提交于 2019-11-30 18:34:39

I was also facing the similar error, below changes did the job.

The issue was Android Studio 2,3 and it's default gradle version is 3.3.

I accidentally updated SDK build tools to latest one 25.0 .0, after Android Studio popped up message to update and Gradle plugin version to 2.3.0 for which required gradle version is 3.3+.

I did the below changes to fix the issue:

  1. Installed older SDK build tools 19.1.0 to use previous Gradle versions
  2. File> Project Structure > Project > And change the gradle version to 2.3.0
  3. Changed build.gradle(Project: app_name) > classpath 'com.android.tools.build:gradle:3.3.0' to 'com.android.tools.build:gradle:2.1.2'

Finally, do Invalidate Caches / Restart or Sync.

It seems like it's better not to use 3.3 yet. Source & Credits

Try to set in your build.gradle:

classpath 'com.android.tools.build:gradle:2.3.0'

In gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

And then check "Use default gradle wrapper (recommended)" in Android Studio settings (Gradle tab).

Sync project or invalidate cash and restart.

Step 1:changes in gradle-wrapper.proprties

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

Step 2:changes in app\build.gradle

 classpath 'com.android.tools.build:gradle:2.3.0'

Step 3: changes in project level build.gradle

classpath 'com.android.tools.build:gradle:2.3.0'

sync your project.
It solved my problem.

Just press in AndroidStudio:

Sync Project with Gradle Files.

Hi i am also got the same problem. But now i got solution

First you should update Android NDK-bundle. This is under File--> Project Structure SDK Location last one. There is one option download.

After Again create new package with all plugins install again Then import the project. That time don't do update again. Then it was working me.

Try it All the best*****

I tried some of the other suggestions here, but ultimately after deleting my .gradle directory and setting everything up again it seemed to be OK

Android studio 2.3 and preview 2.4 requires Gradle version 3.3 & above!!! I had 2.8 it didn't work.
I installed 3.4 & it still didn't work, I figured out that the source directory
was set to 2.8, not 3.4!!
So make sure u have 3.3 or 3.4 installed and the path is set to the correct one... Even don't set the path to say
C:\user......\gardle\bin
set it to
C:\user.....\gradle
I had the problem for days!!!Wish it works well for you....

I had the exact same problem. I debugged the issue by adding debug statements to \platforms\android\cordova\lib\check_reqs.js (90:25). From this debug I found that my previous SDK did have a templates directory - for my installation is is: C:\Android\SDK\tools\templates.

Fortunately I had a backup of that directory. So my final solution for Android 2.3.1 installation was to copy my C:\Android\SDK\tools\templates directory to the newly created SDK directory from the 2.3.1 installation.

I don't like this in-eligant solution but it did immediately resolve my problem.

I hope this helps someone.

i had the same problem. this is how i solved mine:
1. Download gradle-4.0
2.Download NDK using SDK manager
3. open file>settings>Build,Execution,Deployment>gradle and configured as below. Click Here to view image

it solved my problem

Johan

Try my solution

I'm using android studio 2.3.1, i just make a few step to solved the problem.

based on doc at androiddev https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle

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+

Requirement : Gradle version 3.4

Step 1 Remove all gradle in folder C:\Users\.gradle\daemon

Step 2 Redownload Gradle 3.4 and put in directories C:\programfiles\android\androidstudio\gradle

step 3 Configure gradle in android studio 2.3.1 gradle settings. change to folder "C:\Program Files\Android\Android Studio\gradle\gradle-3.4"

Step 4 close your android studio and reopen project

I hope this solution help.

Ziad
  1. Download it manually from https://gradle.org/releases/ .

  2. Extract it and make a dir for it in ur Android Studio And your SYSTEM.

  3. Android Studio: Setting > Build > Gradle > Uncheck Offline Work and put the DIR.

  4. System: Environment Variables > Edit(if u have another gradle PATH) or New > put The DIR.

Have a good day.

Just try to change this line like the below one distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

and refresh it. If it still not works then there can be option which will automatically update your dependencies according to the version installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!