我遇到以下错误!是什么原因
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
大约有80个错误,所有这些都是在api级别低于24的情况下不支持的结尾。我将api级别更改为25,但仍然没有解决问题,有人可以帮我解决这个问题吗?< / p>
答案 0 :(得分:0)
API 24下不支持使用java.util.stream.Stream
对于未运行的设备,您需要进行检查
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.N){
}else{
}