Gradle Stuck and taking long time after updating Android studio 3.0 stable update

我怕爱的太早我们不能终老 提交于 2019-12-01 22:03:21

How I resolve this issue, after upgrading to Android studio 3.0 :

  1. Changed old build version to at least: buildToolsVersion "26.0.2"
  2. Changed compile to implementation
  3. Changed testCompile to androidTestImplementation
  4. Changed older classpath version to 'com.android.tools.build:gradle:3.0.0'
  5. If using local gradle distribution then verify distributionUrl as 4.1-all.zip
  6. Deleted .gradle folder then Clean / Rebuild.

It worked. Thanks.

Nabin Bhandari

Since you upgraded android studio to a newer version, the version of gradle will also be updated.

The message "Refreshing project" means a new version of gradle is being downloaded. About 100MB of file will be downloaded in the meantime.

So make sure you have a stable internet connection and wait for some time till the download completes.

Another possibility:

You have used com.android.tools.build:gradle:2.3.3 in your build.gradle file. Use the corresponding version of gradle as the version of Android Gradle Build Plugin. So use com.android.tools.build:gradle:3.0.0 with Gradle 4.1+

I've experienced the same problem yesterday. After upgrading from Android Studio 2.3 to 3.0, it took a long time to build the project. First, you need to waiting for the Android Studio to download the gradle if you don't use the local gradle. Second, you need to clear by File->Invalid Caches/Restart. Last, you need to delete the .gradle.

sometimes this error happens when it is blocked in your country,then you need to use a VPN like hotspotshield this worked for me

International

Change the dependencies like:

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