Gradle failed when creating project in Android 3.0

1

Hello everyone had been working well since version 2.3.3 but when updating to the new android studio 3.0 it generates an error when creating or opening a project, I have already tried many ways to solve it, from deactivating the offline work option to uninstalling it and install it again, I find myself desperate because I've been trying to solve it for days but I can not do it, attach my gradle configurations.

    
asked by Carlos Perez 14.11.2017 в 18:03
source

2 answers

2

In my case I solve it by updating the Android SDK.

You can do it by following these steps:

  • Go to the SDK Manager
  • Delete version 26.0.2 if you have it and if not download it

    NOTE: If you are not allowed to download, change the name of the folder as in the image

  • Override the cache and restart

  • Try again
  • PDA: This worked for me.

        
    answered by 14.11.2017 в 18:11
    1

    Firstly, it is important to note that you have defined in your project:

       compileSdkVersion 26  
    

    and

    targetSdkVersion 26
    

    Therefore you must install this SDK!

    The minimum version for Android Studio 3.0+ of Gradle , defined in your file build.gradle must be 3.0.0 :

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0'
    
    
        }
    }
    

    If you made an update to Android 3.0 do not forget to perform the cache invalidation in Android Studio and restart.

    File > Invalidate Cache / Restart

        
    answered by 14.11.2017 в 19:33