Debug: AndroidStudio error (Cannot locate factory)

Debug: AndroidStudio error

This error was encountered by  Eddie on 8Jan19

Gradle 'MyApp' refresh failed.

Error:Cannot locate factory for objects of type DefaultGradleConnector, as ConnectorServiceRegistry has been closed.



Gradle 'MyApp' refresh failed. Error:Cannot locate factory for objects of type

You can restart android studio like this:
Click File ----> Invalidate Caches /Restart