Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've setup the environment for react native on Windows. But when I run the command

react-native run-android 

I get the following errors -

* What went wrong: A problem occurred configuring project ':app'. > Failed to notify project evaluation listener.    > Could not initialize class com.android.sdklib.repository.AndroidSdkHandler 

How do I fix this?

like image 407
Paul Santosh Avatar asked Oct 24 '17 18:10

Paul Santosh


1 Answers

This is because your classpath build tools in build.gradle root project is deprecated. Update it like this

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

and after that update your minimum sdk and build tools to latest and no problem again

like image 63
Hasan Jamshaid Avatar answered Nov 16 '22 01:11

Hasan Jamshaid