compileOptions {
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
kotlinOptions {
jvmTarget = '18'
Settings:
Build, Execution, Deployment -> Build Tools -> Gradle
Most probably there's a dependency mismatch.
I got a similar error when trying to add appwrite to my Flutter app. To be specific, flutter_web_auth_2 (a dependency that appwrite depended on) was throwing a similar error.
After hours of trial and error, downgrading my Kotlin version to match the flutter_web_auth_2's Kotlin version solved my issue.
It might be late for you, but I hope I helped someone.
I've the same error... but error starts when I added the "kotlin-kapt" plugin.
If you doesn't need use annotations, don't use it.
Also think to migrate to KSP. https://kotlinlang.org/docs/kapt.html
But with the upgrade to Java 17 its enought.
–
The same problem occurred when turning on the 'Hilt' library, or when adding a Java-module to the project, even an empty one.
I managed to solve it the only way. Made AGP and Gradle versions less than 8.0
The versions of all other components remained maximum.
All other methods did not work. Or do not meet the requirements of the application.
For example, there is such a requirement:
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.