I get this error when trying to run my App on Android Studio. Does anyone know what the reason could be? Thanks.
Gradle 'MyApp' refresh failed. Error:Cannot locate factory for objects of type DefaultGradleConnector, as ConnectorServiceRegistry has been closed.
Bad internet connection: Since Gradle downloads all the missing versions which are required to run your project, it might fail if you don't have a valid internet connection. Issues in Gradle compiler: There might be cases where your Gradle compiler is not working properly.
Reload a linked Gradle project In the Gradle tool window, right-click a linked project. On invoking this action, IntelliJ IDEA parses the project structure in the Gradle tool window. IntelliJ IDEA cannot reload just a part of your project, it reloads the whole project including modules and dependencies.
Restarting Android Studio usually fixes this error for me.
You can restart android studio like this:
Click File ----> Invalidate Caches /Restart
It works for me!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With