joekevinrayan96
joekevinrayan96

Reputation: 634

Not supported in android api level less than 24

I'm getting following errors! what would be the reason

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
Error:Collection.java:47-48: Default method java.util.stream.Stream stream() not supported in Android API level less than 24
Error:Collection.java:41-42: Default method boolean removeIf(java.util.function.Predicate filter) not supported in Android API level less than 24
Error:AnnotatedElement.java:30-31: Default method boolean isAnnotationPresent(java.lang.Class annotationClass) not supported in Android API level less than 24

There are about 80 errors and all of them are ends with not supported in android api level less than 24. I changed the api level to 25 as well still it did not fix the issue can someone help me with this issue?

Upvotes: 3

Views: 2721

Answers (1)

tyczj
tyczj

Reputation: 73721

the use of java.util.stream.Stream is not supported below API 24

for device not running that you need to do a check

if(Build.VERSION.SDK_INT < Build.VERSION_CODES.N){

}else{

}

Upvotes: 1

Related Questions