2

A problem occurred configuring project ':app':

Failed to notify project evaluation listener.
Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

I am trying to build a project for class and have been getting this error while running the test.

What went wrong?

zx485
  • 28,498
  • 28
  • 50
  • 59
Sameep Shah
  • 23
  • 1
  • 6
  • Possibly this covers/solves your issue : https://stackoverflow.com/questions/46917365/error-could-not-initialize-class-com-android-sdklib-repository-androidsdkhandle If not, I would advice adding more details to question, it's too broad right now and anything would be a speculation – Anuj Patel Mar 18 '18 at 23:14

2 Answers2

1

Change java version to 1.8, if you are using this inside app

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
Anjal Saneen
  • 3,109
  • 23
  • 38
1

1- Replace in build.gradle (project)

 dependencies {

        classpath 'com.android.tools.build:gradle:4.2.2'

        classpath 'com.google.gms:google-services:4.3.10'
    }

2- Replace in gradle-wrapper.properties (Gradle Version)

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
Mark Nashat
  • 668
  • 8
  • 9