Reputation: 87
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?
This is what i got in android studio
I have tried several solution: Reset Java_home, Reset No proxy, Reinstall java and android studio
Upvotes: 5
Views: 7348
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
Upvotes: 0
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
Upvotes: 2
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
Reputation: 2582
It seems to me that you're missing the buildscript
block.
You have two options:
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
}
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