I keep getting this error in Android Studio Electric Eel
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
}
I’ve tried using the answers these two posts but nothing works maybe because those posts are older and they were using older versions of Android Studio
https://stackoverflow.com/questions/73099487/plugin-id-com-android-application-version-7-2-0-apply-false-was-not-f
https://stackoverflow.com/questions/71427323/gradle-sync-failed-plugin-id-com-android-application-version-7-1-2-app
I also reinstalled Android Studio and it still didn’t work.
2
Answers
Setting>Build, appearance, deployment>Gradle
Gradle JDK: Jbr-11
I was having the same problem but by using this progress I have solved that problem. You should also try this I hope this will work.
Today I solved it. Previously I set up Gradle JDK: Jbr-11.
My country has internet restrictions so I use "Proton VPN" (free version), and NetLimiter 4 Pro as a firewall to conect my laptop.
The problem dissapeared when i turned off my firewall, with the VPN on. Android Studio started to download files it needed. It worked due the firewall was blocking an Android Studio task i hadn’t seen.
But then another problem appeared in activity_main.xml: "Class referenced in the layout file, ‘androidx.constraintlayout.widget.ConstraintLayout’, was not found in the project or the libraries "
To solve this, try:
Open your build.gradle (application-level) file and make sure that it has the ConstraintLayout dependency.
dependencies {
implementation ‘androidx.constraintlayout:constraintlayout:2.1.4’
//…
}
If the dependency is not there, add the dependency in the build.gradle file and synchronize the project.
If dependency was already there, try cleaning up and rebuilding your project. Build -> Clean Project,
when it finished:
Build -> Rebuild Project.
Delete the .idea folder and let these files download when you open Android Studio. (This is what finally worked for me)