Closed xiaoyvyv closed 1 year ago
same error any resolution for this?
Without more information, all I can tell is what indicated by the error message, that there is no provider found on the classpath. There could be several causes, it might be due to you did not specify the dependency of the processor properly, or the dependency of the processor does not contain a resource file that point to the processor. It will be easier to tell if you can provide a link to the repo that is having this issue.
@neetopia This is Project level and app-level gradle file it gradle syncs properly but whenever I try to build its shows the above error
I am setting up the ksp to use in the project where it was using kapt. and already using it like this in the app and other module like this.
can you check the glide version then? KSP support is not available for glide version earlier than 4.14. At the same time, it might be easier for me to take a look at your repo directly if applicable.
Now getting this is in my core module and my core module plugins setup is same as above app module ss
For memory issues, you can try to increase the maximum heap size for JVM to get around that.
Close for inactive, feel free to reopen if you have more updates.
facing the same [ksp] No providers found in processor classpath. with glide 4.15.1 and lifecycleRuntime 2.5.1. ksp version = 1.7.10 - 1.0.6
i'm facing the same issue, with ksp version = 1.8.21 - 1.0.11
Have the same issue after add Glide version = 4.15.1 to one of my Android module. Ksp version = 1.8.21 - 1.0.11
For such kind of issues, please check if a dependency containing a KSP processor is provided in the dependency declarations via ksp
block. e.g. ksp("com.example:processors")
You can also get this error when you didn't register your SymbolProcessorProvider properly
@neetopia I did declare this in the :core:common module's dependencies, but still have the "No providers found..." issue. However, I have room dependency on the :app module it works just fine
Update:
Turns out that glide ksp compiler should use com.github.bumptech.glide:ksp:$version
instead of com.github.bumptech.glide:compiler:$version
Your are right, glide's document said that use ksp
to replace compiler
the problem i have fixed first:file path like this second:
there is file directory, not package, so you need to operate in project source file like this
not working even for simple project, do I have to config something else except:
plugins {
id("com.google.devtools.ksp")
}
dependencies{
ksp("io.mcarle:io.mcarle:konvert-api:${ksp.version}")
}
[ksp] No providers found in processor classpath. What is wrong with this damnded library... i spent whole day to use ksp in dependencies section and it never works with any ksp/konvert/kotlin version..
Update: I fixed my issue by adding: ksp("io.mcarle:konvert:$konvertVersion") dependency
ksp documentation is very frustrating. By default it mention some providers or what .. most users just need to use it with other libraries like me and this frustrating error make me think that I have to define my custom provider... As I understand libraries like "konverter" provide their own provider for ksp.
ksp "androidx.annotation:annotation:1.8.0"
gets me the famous error: [ksp] No providers found in processor classpath how come?
It seems that still many people are hitting this issue, to be clear, you need to add the package name containing the processor itself to the ksp()
dependency, there is no way for KSP to know which package contains the processor provider therefore you need to specify it yourself, the processor authors should provide a guidance on how to use their processors with KSP by providing the correct names.
Thanks @neetopia for the answer. So there are some people who know how to do this and I'm among the many who don't.
Android developers' site advises it like this:
Replace annotation processors with KSP: kapt 'androidx.room:room-compiler:2.5.0' => ksp 'androidx.room:room-compiler:2.5.0'
And I did it likewise for androidx.annotation: ksp "androidx.annotation:annotation:1.8.0"
But this doesn't work.
I asked Gemini:
how to use ksp on : kapt "androidx.annotation:annotation:1.8.0"
The answer:
While using
kapt
for annotation processing is still possible, it's recommended to migrate to the newer KSP (Kotlin Symbol Processing) approach for better performance and type safety. Here's how to use KSP with your project instead ofkapt
:1. Add KSP Plugin:
- In your app module's
build.gradle
file, add the KSP plugin under theplugins
section:plugins { id 'com.android.application' version '7.X.X' // Replace with your version id 'com.google.devtools.ksp' version '1.X.X' // Replace with compatible version // ... other plugins }
2. Verify KSP Version Compatibility:
- Ensure the KSP plugin version you're using is compatible with your Kotlin compiler version. Refer to the KSP documentation for specific version compatibility details.
3. Check Library Annotations:
- The library using
androidx.annotation:annotation:1.8.0
might not explicitly support KSP processing. You might need to:
- Update the library to a newer version that supports KSP.
- Find an alternative library with better KSP support.
4. Remove kapt Configuration:
- Since you're switching to KSP, remove the
kapt "androidx.annotation:annotation:1.8.0"
line from yourdependencies
block. KSP manages annotation processing automatically.5. Update Build Tools (Optional):
- In some cases, using the latest Android Gradle plugin and build tools versions might be beneficial for optimal KSP integration.
Additional Tips:
- Consider using a tool like Detekt (https://github.com/detekt/detekt) to help identify potential issues with KSP configuration in your project.
- Consult the KSP documentation (https://kotlinlang.org/docs/ksp-quickstart.html) for a detailed guide on using KSP and troubleshooting common issues.
Benefits of KSP:
- Improved Performance: KSP works directly with Kotlin symbols at compile time, offering better performance compared to kapt's bytecode processing.
- Enhanced Type Safety: KSP leverages Kotlin's type system for better type checking during annotation processing.
- Modern Approach: KSP is the future of annotation processing in Kotlin projects.
By following these steps and migrating to KSP, you can take advantage of its benefits and potentially improve your project's performance and maintainability. If you encounter any issues during the migration process, feel free to share the specific errors or challenges you face for further assistance.
So, if I understand it correctly, it's basically saying ksp can not be used with androidx.annotation.
I don't know if its answer is correct or not. If not, that It doesn't know. If It doesn't know about it, who would know? Where are the few enlightened who can advise on how to this?
androidx.annotation:annotation:1.8.0
is not annotation processors but rather a package of the annotation itself, I am not sure if the annotations defined in this package have corresponding annotation processors. The documentation you mentioned is about room processor which is true and you are seeing the documentation also says to use package room-compiler
which is where the annotation processor is located. There is no issue on the android developer documentation.
as a side note, you should always fact-check for genAI answers.
implementation("com.github.bumptech.glide:glide:4.16.0")
ksp("com.github.bumptech.glide:ksp:4.16.0") // using ksp for glide its solve this error
[ksp] No providers found in processor classpath.