Skip to content
Advertisement

Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler

I want to build this project with Android Studio at launching, but take a error. Stacktrace is here

Advertisement

Answer

This problem occurs when there are multiple JDKs installed in your system, I had the same issue as I had mistakenly installed oracle-jdk-9 and Android studio requires oracle-jdk-8

If you are using Ubuntu you can install jdk-8 from this question.

So, Make following changes as shown below:

Press ctrl+shift+alt+s that will open project structure which can also be opened from

File -> Project Structure

And then change JDK Location where you may have installed JDK 8

Here is the link to image

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement