Gradle build failing after update to Android studio 2.3 Canary 3

后端 未结 9 1940
北海茫月
北海茫月 2021-01-03 20:19

I\'ve recently updated the android studio version of my project from 2.3 Canary 2 to 2.3 Canary 3. Since then the gradle build is failing every time with this error:

相关标签:
9条回答
  • 2021-01-03 21:23

    When updating to android studio 2.3, and then load an existing project for older version of android studio, It might take long if not forever on refreshing project. I had the same problem but i fixed it as follows:

    1. first of all go to Gradle Distributions and download any gradle of version greater than 3.2
    2. extract it and save it in a suitable place in your computer.
    3. go to android studio and choose the following path
    4. File->Settings->Build,Execution,Deployment->Gradle
    5. on the right side choose or select Use local gradle distribution
    6. and then browse to where you had saved your downloaded extracted gradle
    7. click apply, then ok.
    8. thats it, your project should now work normally.
    0 讨论(0)
  • 2021-01-03 21:24

    It's mostly happened when setup new or update version of Android studio. I tried almost all solutions and find some fact that I like to share. It's work for me.

    1. Make sure that updated JDK has set up to your computer and set path location.

    Control Panel\System and Security\System-> Advanced system setting -> Advanced -> Enviroment Variables -> edit Path and pest your JDK bin folder location

    Ex: C:\Program Files\Java\jdk1.8.0_131\bin

    1. Set Project-level-setting "Use default Gradle wrapper (recommended)" from,

      Android Studio -> File -> Setting -> Build, Exeution, Deployment -> Gradle

    2. Set Android Studio JDK location:

    Android Studio -> File -> Project Structure -> SDK Location -> JDK location

    1. If this three thing is done then you need to set Gradle version 3.4.1 or see the latest version from gradle.org/releases.

    Android Studio -> File -> Project Structure -> Project -> Gradle Version

    1. After complete setting clean cash Android Studio will recover it own.

    Android Studio -> File -> Invalidate caches/ Restart...

    0 讨论(0)
  • 2021-01-03 21:25

    The solution is to select "Use default gradle wrapper (recommended)" option in the build gradle panel like the image below. Now you can build with gradle 3.2 (in your gradle-wrapper.properties) and android gradle:2.3.0-alpha3 or beta1 as the time of writing

    Don't forget to invalidate cache if you have some trouble using File -> Invalidate Cache / Restart

    0 讨论(0)
提交回复
热议问题