Hello i dunno why the original gradle config didn't work for me but i was able to get it to work using this ( im new to gradle and android in general so maybe i did something wrong feel free to correct me )
so for anyone who is looking at the source code and want to run here is my gradle build
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext{
gradle_version = '4.0.0'
material_design = '1.2.0'
app_compat = '1.1.0'
constraint_lyt = '1.1.3'
espresso_core = '3.2.0'
junit_x_ext = '1.1.1'
kotlin_version = "1.6.0"
}
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
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
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.dev.extensionfunctionusage"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.60"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.appcompat:appcompat:$app_compat"
implementation "androidx.constraintlayout:constraintlayout:$constraint_lyt"
testImplementation "androidx.test.ext:junit:$junit_x_ext"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_core"
implementation "com.google.android.material:material:$material_design"
}