Running our first flutter app might take some time but imagine we run into an issue like this:
So this seems like our app is stuck on “initializing Gradle” so we wait and wait without any clarity or knowing what to do.
What is happening is this — Android Studio is trying to download the Gradle required in the project. But the terminal is not showing us the proper message hence we don’t know that AS is downloading Gradle.
To resolve this issue, we need to know the Gradle version of our project. Open the project in Android Studio android>gradle>wrapper>gradle-wrapper.properties and find the Gradle version there.
Looking at the distributionUrl, the Gradle version is 4.10.2-all.
Now we have to download that exact Gradle version. Copy and paste the URL in your browser and download the Gradle.
Once it is done downloading, copy and paste the zip file in the location where the required Gradle should be located. The directory of my Gradle looks like the below:
So copy and paste the Gradle in the above directory. Then try to run your flutter project. It should work now.
Hope this solves it.