在使用IDEA创建我的第一个Android项目时出现错误
Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources:
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources:
xxxxxxx
xxxxxxx
xxxxxxx
省流:
我这里出错的原因可能是因为Gradle JVM版本较低,
用的Gradle版本是7.5,
而Gradle JVM是1.8,
当我把Gradle JVM后面的选项换成高一点的版本(我直接用了17)之后,
就可以正常sync了。
下面是解决问题的路程,因为我也只是一个编程菜鸟,如果有错误的理解还希望大家指出:
在完成了各种安装流程之后,我开始创建第一个项目,一进来开始sync首先就是这个画面,那让我打开Gradle设置我就打开设置吧
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-1.png)
上面存储下载文件也自己创了个文件夹,
然后把Gradle换成了已经从官网上下载好的7.5,
Gradle JVM则选择了1.8
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-2.png)
重新sync,告诉我gradle.properties有个地方设置有问题,从网上找了这个问题的解决办法,调小了org.gradle.jvmargs,再重新sync
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-3.png)
这就出现了标题所说的问题,告诉我插件在下面的几个仓库里面没找到,找了网上很多方法都解决不掉,后来看到某个视频里面,有个老师说到了Gradle JVM版本太低可能会有问题,那个视频里用的Gradle是7.x,我也就试着改一下
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-4.png)
我直接删了之前那个项目,因为根据网上的说法配置了太多东西,就又重新新建了一个项目,
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-1.png)
这次我把Gradle JVM改成IDEA之前帮我下好的17,手头也没别的,先拿这个试试
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-6.png)
这次没有出现gradle.propertie的org.gradle.jvmargs设置问题
也没有Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources文章来源:https://www.toymoban.com/news/detail-734561.html
一开始sync,就可以正常下载包了...文章来源地址https://www.toymoban.com/news/detail-734561.html
![Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources,gradle,android studio,Powered by 金山文档](https://imgs.yssmx.com/Uploads/2023/10/734561-7.png)
到了这里,关于Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!