如果使用自定义插件较多的同学 可能会碰到坑,升级完ide 以后 可能会导致编译失败
或者报类似编译错误的:
has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at org.gradle.api.internal.plugins.DefaultPluginRegistry$1.load(DefaultPluginRegistry.java:72)
at org.gradle.api.internal.plugins.DefaultPluginRegistry$1.load(DefaultPluginRegistry.java:52)
可以按照如下配置修改:
这样一来 可以保证android studio 是编译过的。但是有些时候 我们在ci上 需要按照命令编译项目
这个时候可能会失败,这是比较麻烦的,需要 装一下java11 环境 然后编译。
如果你出错的插件是你自己的代码 改起来就简单了,只要在你插件代码中 限定好java8的版本即可,如图所示:
然后重新build 以后上传maven ,主app引入新的插件 即可解决问题