Solved — Unable to load class AndroidComponentsExtension after upgrading the Android Gradle Plugin 7.1

After upgrading:

Unable to load class 'com.android.build.api.extension.AndroidComponentsExtension'.This is an unexpected error. Please file a bug containing the idea.log file. 

Log:

A problem occurred evaluating project ':main'.
at

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Flutter Developer

Flutter Developer

Flutter and Native Android developer