Tag Archives: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

[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()

[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

Now, some methods and classes will not be found.

 

Solution:

Go to build.gradle and replace this classpath with the latest version. It is best to also get the latest version of gradle and gradle wrapper. for example:

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
}