在使用IDEA創(chuàng)建我的第一個(gè)Android項(xiàng)目時(shí)出現(xiàn)錯(cuò)誤
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
省流:
我這里出錯(cuò)的原因可能是因?yàn)?span id="n5n3t3z" class="kdocs-bold" style="font-weight:bold;">Gradle JVM版本較低,
用的Gradle版本是7.5,
而Gradle JVM是1.8,
當(dāng)我把Gradle JVM后面的選項(xiàng)換成高一點(diǎn)的版本(我直接用了17)之后,
就可以正常sync了。
下面是解決問(wèn)題的路程,因?yàn)槲乙仓皇且粋€(gè)編程菜鳥(niǎo),如果有錯(cuò)誤的理解還希望大家指出:
在完成了各種安裝流程之后,我開(kāi)始創(chuàng)建第一個(gè)項(xiàng)目,一進(jìn)來(lái)開(kāi)始sync首先就是這個(gè)畫(huà)面,那讓我打開(kāi)Gradle設(shè)置我就打開(kāi)設(shè)置吧
![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)
上面存儲(chǔ)下載文件也自己創(chuàng)了個(gè)文件夾,
然后把Gradle換成了已經(jīng)從官網(wǎng)上下載好的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有個(gè)地方設(shè)置有問(wèn)題,從網(wǎng)上找了這個(gè)問(wèn)題的解決辦法,調(diào)小了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)
這就出現(xiàn)了標(biāo)題所說(shuō)的問(wèn)題,告訴我插件在下面的幾個(gè)倉(cāng)庫(kù)里面沒(méi)找到,找了網(wǎng)上很多方法都解決不掉,后來(lái)看到某個(gè)視頻里面,有個(gè)老師說(shuō)到了Gradle JVM版本太低可能會(huì)有問(wèn)題,那個(gè)視頻里用的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)
我直接刪了之前那個(gè)項(xiàng)目,因?yàn)楦鶕?jù)網(wǎng)上的說(shuō)法配置了太多東西,就又重新新建了一個(gè)項(xiàng)目,
![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,手頭也沒(méi)別的,先拿這個(gè)試試
![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)
這次沒(méi)有出現(xiàn)gradle.propertie的org.gradle.jvmargs設(shè)置問(wèn)題
也沒(méi)有Plugin [id: 'com.android.application', version: '7.3.0', apply: false] was not found in any of the following sources文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-734561.html
一開(kāi)始sync,就可以正常下載包了...文章來(lái)源地址http://www.zghlxwxcb.cn/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)
到了這里,關(guān)于Plugin [id: ‘com.android.application‘, xxx] was not found in any of the following sources的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!