diff --git a/app/build.gradle b/app/build.gradle index ce6f265..121f14e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,7 +17,7 @@ plugins { id 'com.android.application' id 'kotlin-android' - id 'kotlin-kapt' + id 'com.google.devtools.ksp' } android { @@ -53,13 +53,13 @@ dependencies { def room_version = '2.6.1' implementation "androidx.room:room-runtime:$room_version" - kapt "androidx.room:room-compiler:$room_version" - //ksp("androidx.room:room-compiler:$room_version") + //kapt "androidx.room:room-compiler:$room_version" + ksp("androidx.room:room-compiler:$room_version") // optional - Kotlin Extensions and Coroutines support for Room implementation "androidx.room:room-ktx:$room_version" - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0' implementation 'androidx.core:core-ktx:1.15.0' implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'com.google.android.material:material:1.12.0' diff --git a/app/src/main/java/com/example/sqlbasics/MainActivity.kt b/app/src/main/java/com/example/sqlbasics/MainActivity.kt index 398fce5..0b5c07f 100644 --- a/app/src/main/java/com/example/sqlbasics/MainActivity.kt +++ b/app/src/main/java/com/example/sqlbasics/MainActivity.kt @@ -24,6 +24,7 @@ class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + // Don't do this in a production app GlobalScope.launch { AppDatabase.getDatabase(applicationContext).californiaParkDao().getAll() } diff --git a/build.gradle b/build.gradle index 4798813..af28638 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.7.10" + ext.kotlin_version = "2.1.0" repositories { google() mavenCentral() @@ -31,7 +31,8 @@ buildscript { } plugins { - id 'org.jetbrains.kotlin.android' version '1.9.21' apply false + id 'org.jetbrains.kotlin.android' version '2.1.0' apply false + id 'com.google.devtools.ksp' version '2.1.0-1.0.29' apply false } allprojects {