I created a new project and began converting it to use kts instead of groovy. I also included the buildSrc this time around and now stuck on the app module. The android block will not compile in the build.gradle.kts of the app module. I am not finding information from anywhere as to why.
System Information:
Kotlin Version: 1.4.21
Gradle Version: 6.7.1
Java Version: AdoptOpenJDK 11
Android Studio: Android Studio 4.1.1
This is my project build.gradle.kts
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$Versions.kotlin")
}
}
allprojects {
repositories {
google()
jcenter()
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
And this is the app build.gradle.kts. The android block is all red.
plugins {
id("com.android.application")
kotlin("android")
id("kotlin-android-extensions")
}
android {
compileSdkVersion(30)
defaultConfig {
applicationId ="com.dp.brewski"
minSdkVersion(26)
targetSdkVersion(30)
versionCode = 1
versionName = "0.0.1"
testInstrumentationRunner="androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release"){
minifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility =JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
testImplementation "junit:junit:4.+"
androidTestImplementation "androidx.test.ext:junit:1.1.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
}