[Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

The new Android studio (4.2) no longer supports the old one

com.android.tools.build:gradle:2.3.3

However, some methods and classes will not be found.

Go to build Change this classpath to the latest version in gradle. It’s best to update the versions of gradle and gradle wrapper. For example:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

As shown in the figure above, don’t forget Maven plus Google()

Similar Posts: