项目突然报这个错误:Invoke-customs are only supported starting with Android O (--min-api 26)
后来发现是:引入一些三方库时,在sync同步时,会报如下错误:Invoke-customs are only supported starting with Android O (--min-api 26)
这是由于你引入的库中代码包含了Java8中的新特性,比如使用了Lambda 表达式、Stream API、默认方法(默认方法就是一个在接口里面有了一个实现的方法)等;
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

如果选择VERSION_11,就会报另外的错误:
程序包android.content不存在这个错误
1436




被折叠的 条评论
为什么被折叠?



