Плагин [id: 'com.google.devtools.ksp'] не найден.
Что я пытаюсь сделать
Я просто пытаюсь добавить зависимости Room и KSP в новый проект Android Studio, чтобы настроить локальный база данных.
Сообщение об ошибке
Плагин [id: 'com.google.devtools.ksp', версия: '2.0.21-1.0.1'] не найден ни в одном из следующих источников:
- Плагины Gradle Core
- Включенные сборки
- Плагин Репозитории (не удалось разрешить артефакт плагина 'com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.0.21-1.0.1')
Что я пробовал
- Я убедился, что gradlePluginPortal() присутствует в settings.gradle.kts.
- Я добавил псевдоним плагина KSP в свой корневой файл build.gradle.kts.
- Я добавил плагин KSP и зависимости Room в app/build.gradle.kts.
- Я добавил правильные версии и псевдонимы в gradle/libs.versions.toml.
- Я аннулировал кеши и перезапустил Android Studio несколько раз.
- Я проверил наличие проблем с сетью или брандмауэром. Другие зависимости загружаются без проблем.
Код: Выделить всё
gradle/libs.version.tomlКод: Выделить всё
[versions]
agp = "8.13.2"
kotlin = "2.0.21"
coreKtx = "1.17.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
lifecycleRuntimeKtx = "2.10.0"
activityCompose = "1.12.2"
composeBom = "2024.09.00"
navigationCompose = "2.9.6"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
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-compose-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Код: Выделить всё
plugins {
alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
Код: Выделить всё
app/build.gradle.ktsКод: Выделить всё
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
// ... (rest of the file is standard)
dependencies {
implementation(libs.androidx.core.ktx)
// ... other standard compose dependencies
implementation(libs.androidx.navigation.compose)
}
Код: Выделить всё
app/build.gradle.ktsКод: Выделить всё
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.officehelper"
compileSdk {
version = release(36)
}
defaultConfig {
applicationId = "com.example.officehelper"
minSdk = 34
targetSdk = 36
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}
dependencies {
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.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.navigation.compose)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... io-project
Мобильная версия