Closed petukhoudzmitry closed 3 months ago
Is there any solutions to this warning with ksp?
Is there any solutions to this warning with ksp?
It happens if you use both KAPT and KSP tools at the same time. If you want to use KSP and get rid of this warning, you need to migrate all your KAPT to KSP compatible dependencies and remove KAPT from your imports. Also make sure to use the latest versions of KSP, its dependencies and gradle/maven
I have all my dependencies working with KSP, I am suspicious with the alpha support of KSP for dagger and hilt, which are dependencies that I am using in my project.
By the way, would you like to help me with my dependencies? I can show you the code of my gradle.
Waiting for your response.
I have all my dependencies working with KSP, I am suspicious with the alpha support of KSP for dagger and hilt, which are dependencies that I am using in my project.
By the way, would you like to help me with my dependencies? I can show you the code of my gradle.
Waiting for your response.
Sure, I can check your code as soon as I'll have free time. I also used dagger and hilt but I managed to get rid off this warning while keeping them in the project.
Ok, here are the libs and gradle codes:
[versions]
agp = "8.4.1"
kotlin = "2.0.0"
coreKtx = "1.13.1"
junit = "4.13.2"
junitVersion = "1.1.5"
espressoCore = "3.5.1"
lifecycleRuntimeKtx = "2.8.2"
activityCompose = "1.9.0"
composeBom = "2024.06.00"
navComposeVersion = "2.7.7"
room = "2.6.1"
ksp = "2.0.0-1.0.21"
hilt = "2.48.1"
hiltNav = "1.2.0"
dataStore = "1.1.1"
workVersion = "2.9.1"
hiltAndroidx = "1.2.0"
[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-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-material-icons-extended = { group = 'androidx.compose.material', name = 'material-icons-extended', version = '1.7.0-beta03' }
# Navegación
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navComposeVersion" }
hilt-navigation = { group = "androidx.hilt", name = "hilt-navigation", version.ref = "hiltNav" }
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNav" }
# Room - Base de datos
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
androidx-room-testing = { group = "androidx.room", name = "room-testing", version.ref = "room" }
# Dagger Hilt - DI
android-dagger-hilt = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
dagger-compiler = { group = "com.google.dagger", name = "dagger-compiler", version.ref = "hilt" }
dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
# DataStore
androidx-datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "dataStore" }
# WorkManager
androidx-work-runtime = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workVersion" }
dagger-hilt-androidx = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltAndroidx" }
androidx-hilt-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltAndroidx" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
ksp-processor = { id = "com.google.devtools.ksp", version.ref = "ksp" }
dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
Also
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.dagger.hilt.android)
alias(libs.plugins.ksp.processor)
}
android {
namespace = "com.--------------"
compileSdk = 34
defaultConfig {
applicationId = "com.-----------"
minSdk = 30
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
configurations {
create("cleanedAnnotations")
implementation {
exclude(group = "org.jetbrains", module = "annotations")
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
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)
testImplementation(libs.junit)
testImplementation(libs.androidx.room.testing)
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)
implementation(libs.androidx.material.icons.extended)
// Navegación
implementation(libs.androidx.navigation.compose)
implementation(libs.hilt.navigation)
implementation(libs.hilt.navigation.compose)
// Room
implementation(libs.androidx.room.runtime)
annotationProcessor(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
// Dagger Hilt
implementation(libs.android.dagger.hilt)
// DataStore
implementation(libs.androidx.datastore.preferences)
// Work Manager
implementation(libs.androidx.work.runtime)
implementation(libs.androidx.hilt.work)
ksp(libs.dagger.compiler)
ksp(libs.dagger.hilt.android.compiler)
ksp(libs.androidx.room.compiler)
ksp(libs.dagger.hilt.androidx)
}
// 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.jetbrains.kotlin.android) apply false
alias(libs.plugins.ksp.processor) apply false
alias(libs.plugins.dagger.hilt.android) apply false
}
Well, these are my codes, but, apart from the problem related to the dagger warnings, I also have some small problems, for example when inspecting the application, smany "Accessin hidden method of..." appear in the logcat referencing "greylist" that it is not supposed to access, so I may have libraries that are not compatible with each other or maybe deprecated, if you could help me analyze the dependencies I have, I would be very grateful.
i am facing the same issue with: kotlin = "2.0.20" agp = "8.6.0" featureDelivery = "2.1.0" ksp = "2.0.20-1.0.25"
Ok, here are the libs and gradle codes:
[versions] agp = "8.4.1" kotlin = "2.0.0" coreKtx = "1.13.1" junit = "4.13.2" junitVersion = "1.1.5" espressoCore = "3.5.1" lifecycleRuntimeKtx = "2.8.2" activityCompose = "1.9.0" composeBom = "2024.06.00" navComposeVersion = "2.7.7" room = "2.6.1" ksp = "2.0.0-1.0.21" hilt = "2.48.1" hiltNav = "1.2.0" dataStore = "1.1.1" workVersion = "2.9.1" hiltAndroidx = "1.2.0" [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-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-material-icons-extended = { group = 'androidx.compose.material', name = 'material-icons-extended', version = '1.7.0-beta03' } # Navegación androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navComposeVersion" } hilt-navigation = { group = "androidx.hilt", name = "hilt-navigation", version.ref = "hiltNav" } hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNav" } # Room - Base de datos androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" } androidx-room-testing = { group = "androidx.room", name = "room-testing", version.ref = "room" } # Dagger Hilt - DI android-dagger-hilt = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } dagger-compiler = { group = "com.google.dagger", name = "dagger-compiler", version.ref = "hilt" } dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } # DataStore androidx-datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "dataStore" } # WorkManager androidx-work-runtime = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workVersion" } dagger-hilt-androidx = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltAndroidx" } androidx-hilt-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltAndroidx" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } ksp-processor = { id = "com.google.devtools.ksp", version.ref = "ksp" } dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
Also
plugins { alias(libs.plugins.android.application) alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.compose.compiler) alias(libs.plugins.dagger.hilt.android) alias(libs.plugins.ksp.processor) } android { namespace = "com.--------------" compileSdk = 34 defaultConfig { applicationId = "com.-----------" minSdk = 30 targetSdk = 34 versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary = true } } configurations { create("cleanedAnnotations") implementation { exclude(group = "org.jetbrains", module = "annotations") } } buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } buildFeatures { compose = true } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } } 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) testImplementation(libs.junit) testImplementation(libs.androidx.room.testing) 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) implementation(libs.androidx.material.icons.extended) // Navegación implementation(libs.androidx.navigation.compose) implementation(libs.hilt.navigation) implementation(libs.hilt.navigation.compose) // Room implementation(libs.androidx.room.runtime) annotationProcessor(libs.androidx.room.compiler) implementation(libs.androidx.room.ktx) // Dagger Hilt implementation(libs.android.dagger.hilt) // DataStore implementation(libs.androidx.datastore.preferences) // Work Manager implementation(libs.androidx.work.runtime) implementation(libs.androidx.hilt.work) ksp(libs.dagger.compiler) ksp(libs.dagger.hilt.android.compiler) ksp(libs.androidx.room.compiler) ksp(libs.dagger.hilt.androidx) }
// 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.jetbrains.kotlin.android) apply false alias(libs.plugins.ksp.processor) apply false alias(libs.plugins.dagger.hilt.android) apply false }
Well, these are my codes, but, apart from the problem related to the dagger warnings, I also have some small problems, for example when inspecting the application, smany "Accessin hidden method of..." appear in the logcat referencing "greylist" that it is not supposed to access, so I may have libraries that are not compatible with each other or maybe deprecated, if you could help me analyze the dependencies I have, I would be very grateful.
I couldn't reproduce any of the mentioned issues. Please provide more information about your gradle configurations and make sure you applied all my advices.
i am facing the same issue with: kotlin = "2.0.20" agp = "8.6.0" featureDelivery = "2.1.0" ksp = "2.0.20-1.0.25"
I also couldn't reproduce any issue for your data.
During my application build I'm getting this warning:
I got it after migration from KAPT to KSP and it seems to be a problem with KSP since the related issue was closed with no solution provided.
My project level build.gradle.kts file:
My module level buid.gradle.kts file:
My libs.versions.toml file:
The warning appears during compileFullDebugJavaWithJavac process. There are no warnings with KAPT.