In my android code (Kotlin) I am using forEach method of java iterable.
mandatoryViews.forEach { view ->
// my code here
}
Below is my sdk config in build.gradle (app):
minSdkVersion 23
targetSdkVersion 30
Now my code builds fine. I also tried to run it on API 23 pixel device and everything is working fine.
But after I run gradlew lint
to see lint errors, it fails and report gives me this error:
Call requires API level 24 (current min is 23): java.lang.Iterable#forEach
Not able to figure why does lint think it will not work on API 23 whereas on API 23 device my code is running fine.