Wednesday, 21 April 2021

Lint checking doesn't work for Java but works for Kotlin in Android Studio

I've been using Kotlin for a long time, but recently I opened a java project and I noticed that Android Studio isn't recognizing the java code properly as the same as Kotlin. for example when I write java code the lint checking isn't working at all. I'm having a hard time knowing what errors I made and what classes need importing and even the code style isn't applied as the settings.!

On the other hand, when I create a Kotlin class on the same project, everything works well. I've tried opening multiple Java projects and it's the same thing, so it's not a project-specific issue.

Keeping in mind that the project works well and runs without any problem as long there are no errors in the code.


Here's pictures showing the problem:

Java Code: No Errors but code style not applied

enter image description here

Java Code: Error found but no erorr highlighting

enter image description here

Kotlin Code: No Errors and code style is applied

enter image description here

Kotlin Code: Error found and lint is working well

enter image description here



from Lint checking doesn't work for Java but works for Kotlin in Android Studio

No comments:

Post a Comment