Plugin [id: 'org.jetbrains.kotlin.android', version: '1.6.21', apply: false] was not found in any of the following sources:

Viewed 3811

I started learning Kotlin in Android studio a few days ago and I still haven't figured it all out, so having this problem is a big question mark for me, I know nothing yet about gradle. Screen of faild gradle

I just created a new empty activity and it suddenly appears out of nowhere.

this is my buildgradle file :

plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false}

task clean(type: Delete) {
delete rootProject.buildDir}
4 Answers

Android studio will install org.jetbrains.kotlin.android automatically. When you click "sync with Gradle Files" first time, Android studio didn`t react to it. After your second click, it did. that`s all.

I solve this problem by changing my vpn,which make Android studio can connect to google.

below for someone like me in China: 我的解决办法是,Android Studio设置里开代理(socks),这个时候你点“sync with Gradle Files”,会有弹窗,记得勾选HTTPS代理,然后就行了,等它下好就行。 (其实,不要手贱点掉HTTPS代理就不会有问题QAQ)

不勾选HTTPS代理的话,在v2rayN那里会显示rejected。

So the problem is now solved .... for some reason. I just want to add that I really don't understand why (in case someone wants to help me haha).

I tried to open another project, in another widow and I did exactly the same thing. I created a new empty activity to see if the problem was with my computer or the internet. But it wasn't. Everything worked perfectly well. No gradle problems. So I closed the second project, with the idea of really trying to find an answer for my main project, but suddenly it just... worked. I did NOTHING. I just opened a second project.

I really don't get it.

The same thing happened to me. I just created a new project and the problem is solved.

Related