user19928919
user19928919

Reputation: 87

Plugin [id: 'com.android.application', version: '7.3.1', apply: false] was not found in any of the following sources

I have some issue with my android studio. I was using my android studio without any issue, but when i have to update my windows and after finished update windows, this issue pop up. i have this issue before, but i fixed it with no proxy, but this time i tried no proxy, it won't solve the problem, does any expert know how to solve it?

enter image description here This is what i got in android studio

I have tried several solution: Reset Java_home, Reset No proxy, Reinstall java and android studio

enter image description here

Upvotes: 5

Views: 7348

Answers (4)

AiVision
AiVision

Reputation: 4233

I had also faced this issue while using gradle version 8.2.2 in Andriod Studio Hedgehog 2023. Below solution is worked for me. I had changed the gradle JDK version to 17 and sync project again and its working.

File -> Setting -> Build, Execution, Deployment -> Gradle ->Gradle JDK

enter image description here

Upvotes: 0

Ret
Ret

Reputation: 23

For anyone who can't find an answer from the above, in my case I had gradle "offline" mode selected in my gradle file, the solution was to toggle it off

solution

Upvotes: 2

Miled
Miled

Reputation: 129

I solved this issue by changing build.gradle to this:

    buildscript {
    ext {
        kotlin_version = '1.7.20'
    }
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.3.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

Upvotes: 3

Zsolt Boldizsar
Zsolt Boldizsar

Reputation: 2582

It seems to me that you're missing the buildscript block.

You have two options:

  1. Declare it at the beginning of your build.gradle file as follows:
buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}
  1. Declare it at the beginning of your settings.gradle file if you want it to be applied to all your modules in your project (this is generally the case). Read more about it here:
pluginManagement {
    repositories {
        google()
        mavenCentral()
    }
}

Upvotes: -1

Related Questions