在创建自有应用的时候,引入ZBLibrary Module的时候,提示这样的错误
An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing `org.gradle.java.home` in `gradle.properties`.
原因是当前编译工具的JDK版本不对
在当前项目上,打开file-settings
在Settings中的Build,Execution,Deployment--》Build Tools中的-->Grade中,将Grade JDB改成java 11。
如果没有Java 11 ,则自行到Java的官网上进行下载