Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

在使用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换成了已经从官网上下载好的7.5,

Gradle JVM则选择了1.8

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

重新sync,告诉我gradle.properties有个地方设置有问题,从网上找了这个问题的解决办法,调小了org.gradle.jvmargs,再重新sync

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

这就出现了标题所说的问题,告诉我插件在下面的几个仓库里面没找到,找了网上很多方法都解决不掉,后来看到某个视频里面,有个老师说到了Gradle JVM版本太低可能会有问题,那个视频里用的Gradle是7.x,我也就试着改一下

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

我直接删了之前那个项目,因为根据网上的说法配置了太多东西,就又重新新建了一个项目,

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

这次我把Gradle JVM改成IDEA之前帮我下好的17,手头也没别的,先拿这个试试

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

这次没有出现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

一开始sync,就可以正常下载包了…

Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/9f286a8203.html