При добавлении строки ksp(libs.androidx.room.compiler.v252) в dependencies в build.gradle.kts(Module:app) возникает ошибка
При добавлении строки ksp(libs.androidx.room.compiler.v252)
в dependencies
в build.gradle.kts(Module:app)
возникает ошибка
Текст ошибки:
FATAL EXCEPTION: main
Process: com.example.myapp, PID: 19841
java.lang.RuntimeException:
Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.ui.theme.MyhActivity}: android.view.InflateException: Binary XML file line #7 in com.example.myapp:layout/activity_search: Binary XML file line #7 in com.example.myapp:layout/activity_search: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
build.gradle.kts(Project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
id("com.google.devtools.ksp") version "1.9.23-1.0.20" apply false
}
build.gradle.kts(Module):
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("org.jetbrains.kotlin.kapt")
id("com.google.devtools.ksp")
}
android {
namespace = "com.example.myapp"
compileSdk = 34
defaultConfig {
applicationId = "com.example.myapp"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
kotlinOptions {
jvmTarget = "18"
}
buildFeatures {
compose = true
viewBinding = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
val room_version = "2.6.1"
implementation(libs.androidx.room.runtime)
annotationProcessor(libs.androidx.room.compiler)
// To use Kotlin annotation processing tool (kapt)
//noinspection KaptUsageInsteadOfKsp
kapt(libs.androidx.room.compiler)
// To use Kotlin Symbol Processing (KSP)
ksp(libs.androidx.room.compiler.v252)
// optional - Kotlin Extensions and Coroutines support for Room
implementation(libs.androidx.room.ktx)
// optional - RxJava2 support for Room
implementation(libs.androidx.room.rxjava2)
// optional - RxJava3 support for Room
implementation(libs.androidx.room.rxjava3)
// optional - Guava support for Room, including Optional and ListenableFuture
implementation(libs.androidx.room.guava)
// optional - Test helpers
testImplementation(libs.androidx.room.testing)
// optional - Paging 3 Integration
implementation(libs.androidx.room.paging)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.constraintlayout)
implementation(libs.material)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.androidx.activity)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
libs.versions.toml:
[versions]
agp = "8.6.0"
kotlin = "1.9.0"
ksp = "1.9.10-1.0.13"
coreKtx = "1.13.1"
junit = "4.13.2"
junitVersion = "1.2.1"
espressoCore = "3.6.1"
lifecycleRuntimeKtx = "2.8.5"
activityCompose = "1.9.2"
composeBom = "2024.09.01"
navigationCompose = "2.8.0"
appcompat = "1.6.1"
constraintlayout = "2.1.4"
material = "1.6.1"
lifecycleLivedataKtx = "2.8.5"
lifecycleViewmodelKtx = "2.8.5"
navigationFragmentKtx = "2.8.0"
navigationUiKtx = "2.8.0"
activity = "1.9.2"
roomCompiler = "2.5.2"
roomPaging = "2.6.1"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomPaging" }
androidx-room-compiler-v252 = { module = "androidx.room:room-compiler", version.ref = "roomCompiler" }
androidx-room-guava = { module = "androidx.room:room-guava", version.ref = "roomPaging" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomPaging" }
androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "roomPaging" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomPaging" }
androidx-room-rxjava2 = { module = "androidx.room:room-rxjava2", version.ref = "roomPaging" }
androidx-room-rxjava3 = { module = "androidx.room:room-rxjava3", version.ref = "roomPaging" }
androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "roomPaging" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }