Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync failed: Cause: com/android/build/gradle/BaseExtension

I downloaded a project from github and then tried to build it.

But, once Gradle ran, the event log of Android Studio (2.3.3) showed me this:

Gradle sync failed: Cause: com/android/build/gradle/BaseExtension
Consult IDE log for more details (Help | Show Log)

And also

Error:(18, 0) com/android/build/gradle/BaseExtension
<a href="openFile:C:\Users\Gustavo\AndroidStudioProjects\simpletask-android\app\build.gradle">Open File</a>

enter image description here

It seems like Gradle couldn't find Kotlin in the right spot but I don't know how to change this.

Kotlin is installed and updated (to version 1.1.3).

enter image description here

It is also configured as a dependency of the "app" module in the project.

enter image description here

But, as the last image shows, the version of the external library that the project sees is 1.0.6 and not 1.1.3.

enter image description here

Is that the problem? How can I change this external library?

like image 721
gustavogbc Avatar asked Jul 02 '17 14:07

gustavogbc


1 Answers

In my case, I had to put everything into app/build.gradle (and not the root build.gradle):

    dependencies {
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }

If I put the block above in the root build.gradle, I get the same error as you...

like image 119
mbonnin Avatar answered Sep 18 '22 10:09

mbonnin