美文网首页
Error: Static interface methods

Error: Static interface methods

作者: dashingqi | 来源:发表于2019-09-29 11:01 被阅读0次

报错明细

Static interface methods are only supported starting with Android N (--min-api 24): 

问题分析以及解决办法

分析

由于在Java8才支持静态接口的方法。

解决办法
  • 在app的build.gradle中加入下面的代码,重新编译运行就可以了。
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

相关文章

网友评论

      本文标题:Error: Static interface methods

      本文链接:https://www.haomeiwen.com/subject/lyyructx.html