Gradle build errors after updating Android Studio

前端 未结 11 2191
无人共我
无人共我 2020-12-12 23:30

I just updated Android Studio, and now when I try to build my app, I get the following Gradle error:

Information: Compilation completed with 2 e         


        
相关标签:
11条回答
  • 2020-12-13 00:06

    This works for me to get rid of "Try Again" on the top about Gradle errors.

    File >> Project Structure >> Project >> Android Gradle Plugin Version = 3.2.1 and Gradle Version 5.1.1 >> Ok >> Apply
    
    Android Studio >> Build >> Make Project
    

    You may get fine, but it will pop-up again for "Update Gradle" I choose "Do not remind me for this project"

    0 讨论(0)
  • 2020-12-13 00:07

    For me the problem was that in OS X, I need set my ANDROID_HOME to a full path, such as:

    export ANDROID_HOME="/Users/username/Development/android-sdk-macosx"
    

    When using the user directory shorthand (~) Gradle seems to consider it a relative directory.

    0 讨论(0)
  • 2020-12-13 00:07

    I had same issue, because my office PC is 32-bit and my home PC is 64 bit. In the local.properties file, I changed

    sdk.dir=C:/Program Files/Android/android-studio/sdk

    to

    sdk.dir=C:/Program Files (x86)/Android/android-studio1/sdk

    note the x86 version of Program Files

    0 讨论(0)
  • 2020-12-13 00:11

    //according to my android studio project folder

    just go into local file and open it into notepad then include the following line according to your project sdk file

    sdk.dir=C\:/Users/raj/AppData/Local/Android/android-studio/sdk //

    0 讨论(0)
  • 2020-12-13 00:17

    The most likely cause is the local.properties file is incorrect.

    Check in the root folder and app folder for local.properties and make sure they point to the SDK folder. Both files must point to the SDK folder for this to work.

    sdk.dir=C:\Users\me\AppData\Local\Android\Sdk

    0 讨论(0)
  • 2020-12-13 00:20

    Took me forever to find it but this was fixed with buddahbrot's suggestion of creating a local.properties file in the root of your project folder to include sdk.dir= followed by the path to the sdk location.

    This worked fine before with just ANDROID_HOME set in Windows but in OSX, I needed to specify with sdk.dir.

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