Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed
Use this build.gradle in your project
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.fileobserver"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Top level build.gradle downgrade version
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
I had a same problem. Currently,the best option is to downgrade your class path to the last stable version. For me, i changed my class path to *classpath 'com.android.tools.build:gradle:3.3.2'*and it worked for me. In Android studio 3.4, you can easily downgrade Android Gradle Plugin Version.
Edit (Issue solved): Installing Service pack 1 for window 7 solved the issue. The problem was with Universal C Runtime in Windows.