After updating Android studio to 3.2, and making the corresponding changes to the gradle version and gradle plugins, I can no longer run ./gradlew from the command line without getting errors. I can still sync gradle and build the app from the toolbar however. The error I get is:
> Failed to apply plugin [id 'com.android.application']
> Could not create an instance of type com.android.build.gradle.AppExtension_Decorated.
> Could not create an instance of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet.
> Uninitialized object exists on backward branch 70
Exception Details:
Location:
com/android/build/gradle/internal/scope/BuildArtifactsHolder.newArtifact(Lcom/android/build/api/artifact/BuildableArtifact;)Lcom/android/build/gradle/internal/scope/BuildArtifactsHolder$BuildableArtifactData; @119: goto
Reason:
Error exists in the bytecode
Any help in understanding what is going wrong would be really appreciated. I am using the jdk embedded in Android Studio, and have tried deleting various folders like .gradle, build, .idea and reimporting the project, but nothing seems to fix it. I am using Kotlin if that is relevant. Not really sure how to go about debugging this.
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
relevant portion of project root build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha08'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.31"
}