Код: Выделить всё
"Unable to find method ''java.lang.String com.squareup.javapoet.ClassName.canonicalName()''
'java.lang.String com.squareup.javapoet.ClassName.canonicalName()'
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes."
В проекте я использую Hilt для внедрения зависимостей, и у меня такое ощущение, что проблема может быть именно здесь, но сколько бы я ни проверял, все аннотации верны.
Это скрипт Gradle на уровне модуля
Код: Выделить всё
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt.plugin)
}
android {
namespace = "com.bdavidgm.consumoelectrico"
compileSdk = 36
defaultConfig {
applicationId = "com.bdavidgm.consumoelectrico"
minSdk = 26
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_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
}
configurations.all {
resolutionStrategy {
eachDependency {
if (requested.group == "com.squareup" && requested.name == "javapoet") {
useVersion("1.13.0")
}
}
}
}
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.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.room.common.jvm)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.runtime)
implementation(libs.material3)
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)
// For datastore
// Preferences DataStore (SharedPreferences like APIs)
implementation("androidx.datastore:datastore-preferences:1.2.0")
// Alternatively - without an Android dependency.
implementation("androidx.datastore:datastore-preferences-core:1.2.0")
// For encryption
implementation("androidx.security:security-crypto:1.1.0")
// Hilt
implementation("com.google.dagger:hilt-android:2.57.1")
ksp("com.google.dagger:hilt-android-compiler:2.57.1")
//material icons
implementation("androidx.compose.material:material-icons-core:1.7.8")
implementation("androidx.compose.material:material-icons-extended:1.7.8")
}
Код: Выделить всё
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
https://github.com/bdavidgm/Consumo-electrico.git
Подробнее здесь: https://stackoverflow.com/questions/798 ... me-canonic
Мобильная версия