报 Plugin [id: 'com.android.application', version: '8.1.3', apply: false] was not found in any of the following sources:
场景:在一个Android 11的项目中添加一个Android 9的项目作为其Module,结果导致原项目无法正常运行,且原项目的启动module在Project Structure中消失了。将添加的module移除后,就报了:
java
Plugin [id: 'com.android.application', version: '8.1.3', apply: false] was not found in any of the following sources:
解决方法:
点击菜单项 Build -> Clean Project,然后点击 Build -> Rebuild Project
gradle和android使用了不同路径的jdk
解决方案:可以在项目的根目录下查找或新建 gradle.properties ,在其中配置 jdk 路径,如下:
bash
org.gradle.java.home=C:\Program Files\Java\jdk1.8.0_202